We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eb93891 commit 8f335c9Copy full SHA for 8f335c9
examples/74hc595_8_led.py
@@ -0,0 +1,27 @@
1
+import time
2
+import board
3
+import digitalio
4
+import adafruit_74hc595
5
+
6
+latch_pin = digitalio.DigitalInOut(board.D5)
7
+sr = adafruit_74hc595.ShiftRegister74HC595(board.SPI(), latch_pin)
8
9
+# Create the pin objects in a list
10
+pins = [sr.get_pin(n) for n in range(8)]
11
12
+while True:
13
+ for _ in range(2): # Run the chase animation twice
14
+ for enabled_pin in range(len(pins)):
15
+ for pin_number, pin in enumerate(pins):
16
+ if pin_number == enabled_pin:
17
+ pin.value = True
18
+ else:
19
+ pin.value = False
20
+ time.sleep(0.01)
21
+ for _ in range(3): # Run the blink animation three times
22
+ for pin in pins:
23
24
+ time.sleep(0.5)
25
26
27
0 commit comments