-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code to turn all LEDs on for 0.5 seconds, and off for 0.5 second, generating a flashing array of LEDs with an appropriate flash rate.
- Loading branch information
1 parent
d29ad23
commit 8ee9248
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import piface.pfio as pfio | ||
|
||
pfio.init() | ||
|
||
while True: | ||
|
||
# turn LED pins 1 to 10 on | ||
pfio.digital_write(1, 1) | ||
pfio.digital_write(2, 1) | ||
pfio.digital_write(3, 1) | ||
pfio.digital_write(4, 1) | ||
pfio.digital_write(5, 1) | ||
pfio.digital_write(6, 1) | ||
pfio.digital_write(7, 1) | ||
pfio.digital_write(8, 1) | ||
pfio.digital_write(9, 1) | ||
pfio.digital_write(10, 1) | ||
|
||
time.sleep(0.5) # LEDs stay on for half a second | ||
|
||
# turn LED pins 1 to 10 off | ||
pfio.digital_write(1, 0) | ||
pfio.digital_write(2, 0) | ||
pfio.digital_write(3, 0) | ||
pfio.digital_write(4, 0) | ||
pfio.digital_write(5, 0) | ||
pfio.digital_write(6, 0) | ||
pfio.digital_write(7, 0) | ||
pfio.digital_write(8, 0) | ||
pfio.digital_write(9, 0) | ||
pfio.digital_write(10, 0) | ||
|
||
time.sleeo(0.5) # LEDs stay off for half a second |