Skip to content

Commit f4c100f

Browse files
authored
Update is31fl3731_blink_example.py
Old code works fine for width of 15, 16 or 17 but does not look good on width of 11.
1 parent 8adf0ba commit f4c100f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/is31fl3731_blink_example.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
display = Display(i2c)
2828

29+
offset = (display.width - 8)//2
30+
2931
# first load the frame with the arrows; moves the an_arrow to the right in each
3032
# frame
3133
display.sleep(True) # turn display off while updating blink bits
@@ -35,7 +37,7 @@
3537
for x in range(8):
3638
bit = 1 << (7 - x) & row
3739
if bit:
38-
display.pixel(x + 4, y, 50, blink=True)
40+
display.pixel(x + offset, y, 50, blink=True)
3941

4042
display.blink(1000) # ranges from 270 to 2159; smaller the number to faster blink
4143
display.sleep(False) # turn display on

0 commit comments

Comments
 (0)