Skip to content

Commit 76d28fd

Browse files
authored
Merge pull request #23 from dglaude/master
Add support for Scroll pHAT HD from Pimoroni
2 parents 69c6ebb + 0ccd09d commit 76d28fd

6 files changed

+28
-0
lines changed

adafruit_is31fl3731.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,3 +387,20 @@ def pixel_addr(x, y):
387387
if x >= 8:
388388
return (x-6) * 16 - (y + 1)
389389
return (x+1) * 16 + (7 - y)
390+
391+
392+
class ScrollPhatHD(Matrix):
393+
"""Supports the Scroll pHAT HD by Pimoroni"""
394+
width = 17
395+
height = 7
396+
397+
@staticmethod
398+
def pixel_addr(x, y):
399+
"""Translate an x,y coordinate to a pixel index."""
400+
if x <= 8:
401+
x = 8 - x
402+
y = 6 - y
403+
else:
404+
x = x - 8
405+
y = y - 8
406+
return x * 16 + y

examples/is31fl3731_blink_example.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#display = adafruit_is31fl3731.Matrix(i2c)
1414
# uncomment line if you are using Adafruit 16x9 Charlieplexed PWM LED Matrix
1515
#display = adafruit_is31fl3731.CharlieBonnet(i2c)
16+
# initial display using Pimoroni Scroll Phat HD LED 17 x 7
17+
#display = adafruit_is31fl3731.ScrollPhatHD(i2c)
1618

1719
# first load the frame with the arrows; moves the an_arrow to the right in each
1820
# frame

examples/is31fl3731_frame_example.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#display = adafruit_is31fl3731.Matrix(i2c)
1515
# uncomment line if you are using Adafruit 16x9 Charlieplexed PWM LED Matrix
1616
#display = adafruit_is31fl3731.CharlieBonnet(i2c)
17+
# initial display using Pimoroni Scroll Phat HD LED 17 x 7
18+
#display = adafruit_is31fl3731.ScrollPhatHD(i2c)
1719

1820

1921
# first load the frame with the arrows; moves the arrow to the right in each

examples/is31fl3731_simpletest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
# uncomment next line if you are using Adafruit 16x8 Charlieplexed Bonnet
1414
#display = adafruit_is31fl3731.CharlieBonnet(i2c)
1515

16+
# initial display using Pimoroni Scroll Phat HD LED 17 x 7
17+
#display = adafruit_is31fl3731.ScrollPhatHD(i2c)
18+
1619
# draw a box on the display
1720
# first draw the top and bottom edges
1821
for x in range(display.width):

examples/is31fl3731_text_example.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#display = adafruit_is31fl3731.Matrix(i2c)
1313
# uncomment line if you are using Adafruit 16x9 Charlieplexed PWM LED Matrix
1414
display = adafruit_is31fl3731.CharlieBonnet(i2c)
15+
# initial display using Pimoroni Scroll Phat HD LED 17 x 7
16+
#display = adafruit_is31fl3731.ScrollPhatHD(i2c)
1517

1618
text_to_show = "Adafruit!!"
1719

examples/is31fl3731_wave_example.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#display = adafruit_is31fl3731.Matrix(i2c)
1515
# uncomment next line if you are using Adafruit 16x8 Charlieplexed Bonnet
1616
#display = adafruit_is31fl3731.CharlieBonnet(i2c)
17+
# initial display using Pimoroni Scroll Phat HD LED 17 x 7
18+
#display = adafruit_is31fl3731.ScrollPhatHD(i2c)
1719

1820
while True:
1921
for incr in range(24):

0 commit comments

Comments
 (0)