summaryrefslogtreecommitdiff
path: root/commandline/examples/ssd1306-show
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-04-11 09:37:25 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-04-11 09:37:25 +0200
commitf7966df39849bfc0c6954d058a621da0d58335e0 (patch)
tree059d3f810a379beb93d38c190e371951ea1f136f /commandline/examples/ssd1306-show
parente5f488ae91a7d7862efad5762794206b701ea25c (diff)
examples/ssd1306: add support for 128x32 displays
Diffstat (limited to 'commandline/examples/ssd1306-show')
-rwxr-xr-xcommandline/examples/ssd1306-show6
1 files changed, 3 insertions, 3 deletions
diff --git a/commandline/examples/ssd1306-show b/commandline/examples/ssd1306-show
index bac18da..63a63cd 100755
--- a/commandline/examples/ssd1306-show
+++ b/commandline/examples/ssd1306-show
@@ -3,8 +3,8 @@
WR_CMD=0x80
WR_DATA=0x40
-WIDTH=128
-HEIGHT=64
+: ${WIDTH:=128}
+: ${HEIGHT:=64}
SET_CONTRAST=0x81
SET_ENTIRE_ON=0xa4
@@ -33,5 +33,5 @@ for cmd in $SET_COL_ADDR 0 $(( WIDTH - 1 )) \
done
for offset in $(seq 0 7); do
- vusb-i2cset 0x3c $WR_DATA $("${BASE}/ssd1306-getpixels" "$1" $(( offset * 128 )))
+ vusb-i2cset 0x3c $WR_DATA $("${BASE}/ssd1306-getpixels" "$1" $(( offset * 128 )) "${WIDTH}" "${HEIGHT}")
done