Last active
December 17, 2015 17:59
-
-
Save mapkyca/5649913 to your computer and use it in GitHub Desktop.
As a teaching/learning aid, here is a simple bit of code to cycle through the LEDs / Outputs on a Raspberry Pi with Piface attachment board.
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
import piface.pfio | |
import time | |
import sys | |
def main(argv): | |
piface.pfio.init() | |
cnt = 0 | |
loop = 0 | |
while loop < 10: | |
for cnt in range(0, 8): | |
led = piface.pfio.LED(cnt) | |
led.turn_on() | |
time.sleep(1) | |
led.turn_off() | |
loop = loop+1 | |
if __name__ == "__main__": | |
sys.exit(main(sys.argv)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment