Skip to content

Commit

Permalink
Merge pull request #40 from dglaude/patch-1
Browse files Browse the repository at this point in the history
Make example better/ready for Pico & 11x7 LED Matrix Breakout
  • Loading branch information
makermelissa committed Mar 9, 2021
2 parents d64cff1 + 61a2679 commit 11533d4
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
9 changes: 8 additions & 1 deletion examples/is31fl3731_blink_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
# from adafruit_is31fl3731.charlie_bonnet import CharlieBonnet as Display
# uncomment next line if you are using Pimoroni Scroll Phat HD LED 17 x 7
# from adafruit_is31fl3731.scroll_phat_hd import ScrollPhatHD as Display
# uncomment next line if you are using Pimoroni 11x7 LED Matrix Breakout
# from adafruit_is31fl3731.matrix_11x7 import Matrix11x7 as Display

# uncomment this line if you use a Pico, here with SCL=GP21 and SDA=GP20.
# i2c = busio.I2C(board.GP21, board.GP20)

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

Expand All @@ -21,6 +26,8 @@

display = Display(i2c)

offset = (display.width - 8) // 2

# first load the frame with the arrows; moves the an_arrow to the right in each
# frame
display.sleep(True) # turn display off while updating blink bits
Expand All @@ -30,7 +37,7 @@
for x in range(8):
bit = 1 << (7 - x) & row
if bit:
display.pixel(x + 4, y, 50, blink=True)
display.pixel(x + offset, y, 50, blink=True)

display.blink(1000) # ranges from 270 to 2159; smaller the number to faster blink
display.sleep(False) # turn display on
8 changes: 6 additions & 2 deletions examples/is31fl3731_frame_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
# from adafruit_is31fl3731.charlie_bonnet import CharlieBonnet as Display
# uncomment next line if you are using Pimoroni Scroll Phat HD LED 17 x 7
# from adafruit_is31fl3731.scroll_phat_hd import ScrollPhatHD as Display
# uncomment next line if you are using Pimoroni 11x7 LED Matrix Breakout
# from adafruit_is31fl3731.matrix_11x7 import Matrix11x7 as Display

# uncomment this line if you use a Pico, here with SCL=GP21 and SDA=GP20.
# i2c = busio.I2C(board.GP21, board.GP20)

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

Expand All @@ -22,11 +27,10 @@

display = Display(i2c)


# first load the frame with the arrows; moves the arrow to the right in each
# frame
display.sleep(True) # turn display off while frames are updated
for frame in range(8):
for frame in range(display.width - 8):
display.frame(frame, show=False)
display.fill(0)
for y in range(display.height):
Expand Down
5 changes: 5 additions & 0 deletions examples/is31fl3731_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
# from adafruit_is31fl3731.charlie_bonnet import CharlieBonnet as Display
# uncomment next line if you are using Pimoroni Scroll Phat HD LED 17 x 7
# from adafruit_is31fl3731.scroll_phat_hd import ScrollPhatHD as Display
# uncomment next line if you are using Pimoroni 11x7 LED Matrix Breakout
# from adafruit_is31fl3731.matrix_11x7 import Matrix11x7 as Display

# uncomment this line if you use a Pico, here with SCL=GP21 and SDA=GP20.
# i2c = busio.I2C(board.GP21, board.GP20)

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

Expand Down
5 changes: 5 additions & 0 deletions examples/is31fl3731_text_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

# uncomment next line if you are using Pimoroni Scroll Phat HD LED 17 x 7
# from adafruit_is31fl3731.scroll_phat_hd import ScrollPhatHD as Display
# uncomment next line if you are using Pimoroni 11x7 LED Matrix Breakout
# from adafruit_is31fl3731.matrix_11x7 import Matrix11x7 as Display

# uncomment this line if you use a Pico, here with SCL=GP21 and SDA=GP20.
# i2c = busio.I2C(board.GP21, board.GP20)

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

Expand Down
5 changes: 5 additions & 0 deletions examples/is31fl3731_wave_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
# from adafruit_is31fl3731.charlie_bonnet import CharlieBonnet as Display
# uncomment next line if you are using Pimoroni Scroll Phat HD LED 17 x 7
# from adafruit_is31fl3731.scroll_phat_hd import ScrollPhatHD as Display
# uncomment next line if you are using Pimoroni 11x7 LED Matrix Breakout
# from adafruit_is31fl3731.matrix_11x7 import Matrix11x7 as Display

# uncomment this line if you use a Pico, here with SCL=GP21 and SDA=GP20.
# i2c = busio.I2C(board.GP21, board.GP20)

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

Expand Down

0 comments on commit 11533d4

Please sign in to comment.