Skip to content

Instantly share code, notes, and snippets.

@mapkyca
Last active December 17, 2015 17:59
Show Gist options
  • Save mapkyca/5649913 to your computer and use it in GitHub Desktop.
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.
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