Skip to content

Commit 608f54d

Browse files
committed
feat: blink led for ten seconds
1 parent 8db5d85 commit 608f54d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

chapter02/led_pigpio.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
pi = pigpio.pi() # (2)
1616
pi.set_mode(GPIO_PIN, pigpio.OUTPUT) # (3)
1717

18-
while True:
18+
print("Blinking LED for 10 seconds...")
19+
for i in range(5):
1920
pi.write(GPIO_PIN, 1) # 1 = High = On # (4)
2021
sleep(1) # 1 second
2122
pi.write(GPIO_PIN, 0) # 0 = Low = Off # (5)
2223
sleep(1) # 1 second
24+
print("Done")

0 commit comments

Comments
 (0)