Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. # import the modules and
  2. libraries needed to control the PiFace
  3. #
  4. on
  5. the Raspberry Pi by typing:
  6. import pifacedigitalio as p
  7. import time
  8. #
  9. Initialize the PiFace library
  10. p.init()
  11. #
  12. Specify the output pin
  13. that the LED connects to on the
  14. PiFace
  15. led =
  16. 0
  17. # Turn the LED on
  18. -
  19. the value 1, or True, represents on and the
  20. #
  21. value 0, or False, represents off.
  22. p.
  23. digital_write
  24. (led, 1)
  25. # Leave the LED on for 5 seconds
  26. time.sleep(5)
  27. # Turn the LED off
  28. p.
  29. digital_write
  30. (led, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement