Skip to content

Commit 11533d4

Browse files
authored
Merge pull request #40 from dglaude/patch-1
Make example better/ready for Pico & 11x7 LED Matrix Breakout
2 parents d64cff1 + 61a2679 commit 11533d4

5 files changed

+29
-3
lines changed

examples/is31fl3731_blink_example.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
# from adafruit_is31fl3731.charlie_bonnet import CharlieBonnet as Display
1414
# uncomment next line if you are using Pimoroni Scroll Phat HD LED 17 x 7
1515
# from adafruit_is31fl3731.scroll_phat_hd import ScrollPhatHD as Display
16+
# uncomment next line if you are using Pimoroni 11x7 LED Matrix Breakout
17+
# from adafruit_is31fl3731.matrix_11x7 import Matrix11x7 as Display
18+
19+
# uncomment this line if you use a Pico, here with SCL=GP21 and SDA=GP20.
20+
# i2c = busio.I2C(board.GP21, board.GP20)
1621

1722
i2c = busio.I2C(board.SCL, board.SDA)
1823

@@ -21,6 +26,8 @@
2126

2227
display = Display(i2c)
2328

29+
offset = (display.width - 8) // 2
30+
2431
# first load the frame with the arrows; moves the an_arrow to the right in each
2532
# frame
2633
display.sleep(True) # turn display off while updating blink bits
@@ -30,7 +37,7 @@
3037
for x in range(8):
3138
bit = 1 << (7 - x) & row
3239
if bit:
33-
display.pixel(x + 4, y, 50, blink=True)
40+
display.pixel(x + offset, y, 50, blink=True)
3441

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

examples/is31fl3731_frame_example.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
# from adafruit_is31fl3731.charlie_bonnet import CharlieBonnet as Display
1515
# uncomment next line if you are using Pimoroni Scroll Phat HD LED 17 x 7
1616
# from adafruit_is31fl3731.scroll_phat_hd import ScrollPhatHD as Display
17+
# uncomment next line if you are using Pimoroni 11x7 LED Matrix Breakout
18+
# from adafruit_is31fl3731.matrix_11x7 import Matrix11x7 as Display
19+
20+
# uncomment this line if you use a Pico, here with SCL=GP21 and SDA=GP20.
21+
# i2c = busio.I2C(board.GP21, board.GP20)
1722

1823
i2c = busio.I2C(board.SCL, board.SDA)
1924

@@ -22,11 +27,10 @@
2227

2328
display = Display(i2c)
2429

25-
2630
# first load the frame with the arrows; moves the arrow to the right in each
2731
# frame
2832
display.sleep(True) # turn display off while frames are updated
29-
for frame in range(8):
33+
for frame in range(display.width - 8):
3034
display.frame(frame, show=False)
3135
display.fill(0)
3236
for y in range(display.height):

examples/is31fl3731_simpletest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
# from adafruit_is31fl3731.charlie_bonnet import CharlieBonnet as Display
1414
# uncomment next line if you are using Pimoroni Scroll Phat HD LED 17 x 7
1515
# from adafruit_is31fl3731.scroll_phat_hd import ScrollPhatHD as Display
16+
# uncomment next line if you are using Pimoroni 11x7 LED Matrix Breakout
17+
# from adafruit_is31fl3731.matrix_11x7 import Matrix11x7 as Display
18+
19+
# uncomment this line if you use a Pico, here with SCL=GP21 and SDA=GP20.
20+
# i2c = busio.I2C(board.GP21, board.GP20)
1621

1722
i2c = busio.I2C(board.SCL, board.SDA)
1823

examples/is31fl3731_text_example.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414

1515
# uncomment next line if you are using Pimoroni Scroll Phat HD LED 17 x 7
1616
# from adafruit_is31fl3731.scroll_phat_hd import ScrollPhatHD as Display
17+
# uncomment next line if you are using Pimoroni 11x7 LED Matrix Breakout
18+
# from adafruit_is31fl3731.matrix_11x7 import Matrix11x7 as Display
19+
20+
# uncomment this line if you use a Pico, here with SCL=GP21 and SDA=GP20.
21+
# i2c = busio.I2C(board.GP21, board.GP20)
1722

1823
i2c = busio.I2C(board.SCL, board.SDA)
1924

examples/is31fl3731_wave_example.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
# from adafruit_is31fl3731.charlie_bonnet import CharlieBonnet as Display
1414
# uncomment next line if you are using Pimoroni Scroll Phat HD LED 17 x 7
1515
# from adafruit_is31fl3731.scroll_phat_hd import ScrollPhatHD as Display
16+
# uncomment next line if you are using Pimoroni 11x7 LED Matrix Breakout
17+
# from adafruit_is31fl3731.matrix_11x7 import Matrix11x7 as Display
18+
19+
# uncomment this line if you use a Pico, here with SCL=GP21 and SDA=GP20.
20+
# i2c = busio.I2C(board.GP21, board.GP20)
1621

1722
i2c = busio.I2C(board.SCL, board.SDA)
1823

0 commit comments

Comments
 (0)