Skip to content

Add support for Scroll pHAT HD from Pimoroni #23

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 13 commits into from
Mar 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions adafruit_is31fl3731.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,3 +387,20 @@ def pixel_addr(x, y):
if x >= 8:
return (x-6) * 16 - (y + 1)
return (x+1) * 16 + (7 - y)


class ScrollPhatHD(Matrix):
"""Supports the Scroll pHAT HD by Pimoroni"""
width = 17
height = 7

@staticmethod
def pixel_addr(x, y):
"""Translate an x,y coordinate to a pixel index."""
if x <= 8:
x = 8 - x
y = 6 - y
else:
x = x - 8
y = y - 8
return x * 16 + y
2 changes: 2 additions & 0 deletions examples/is31fl3731_blink_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#display = adafruit_is31fl3731.Matrix(i2c)
# uncomment line if you are using Adafruit 16x9 Charlieplexed PWM LED Matrix
#display = adafruit_is31fl3731.CharlieBonnet(i2c)
# initial display using Pimoroni Scroll Phat HD LED 17 x 7
#display = adafruit_is31fl3731.ScrollPhatHD(i2c)

# first load the frame with the arrows; moves the an_arrow to the right in each
# frame
Expand Down
2 changes: 2 additions & 0 deletions examples/is31fl3731_frame_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#display = adafruit_is31fl3731.Matrix(i2c)
# uncomment line if you are using Adafruit 16x9 Charlieplexed PWM LED Matrix
#display = adafruit_is31fl3731.CharlieBonnet(i2c)
# initial display using Pimoroni Scroll Phat HD LED 17 x 7
#display = adafruit_is31fl3731.ScrollPhatHD(i2c)


# first load the frame with the arrows; moves the arrow to the right in each
Expand Down
3 changes: 3 additions & 0 deletions examples/is31fl3731_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
# uncomment next line if you are using Adafruit 16x8 Charlieplexed Bonnet
#display = adafruit_is31fl3731.CharlieBonnet(i2c)

# initial display using Pimoroni Scroll Phat HD LED 17 x 7
#display = adafruit_is31fl3731.ScrollPhatHD(i2c)

# draw a box on the display
# first draw the top and bottom edges
for x in range(display.width):
Expand Down
2 changes: 2 additions & 0 deletions examples/is31fl3731_text_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#display = adafruit_is31fl3731.Matrix(i2c)
# uncomment line if you are using Adafruit 16x9 Charlieplexed PWM LED Matrix
display = adafruit_is31fl3731.CharlieBonnet(i2c)
# initial display using Pimoroni Scroll Phat HD LED 17 x 7
#display = adafruit_is31fl3731.ScrollPhatHD(i2c)

text_to_show = "Adafruit!!"

Expand Down
2 changes: 2 additions & 0 deletions examples/is31fl3731_wave_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#display = adafruit_is31fl3731.Matrix(i2c)
# uncomment next line if you are using Adafruit 16x8 Charlieplexed Bonnet
#display = adafruit_is31fl3731.CharlieBonnet(i2c)
# initial display using Pimoroni Scroll Phat HD LED 17 x 7
#display = adafruit_is31fl3731.ScrollPhatHD(i2c)

while True:
for incr in range(24):
Expand Down