Skip to content

Make example better/ready for Pico & 11x7 LED Matrix Breakout #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 9, 2021
Merged
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