Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # import the modules and
- libraries needed to control the PiFace
- #
- on
- the Raspberry Pi by typing:
- import pifacedigitalio as p
- import time
- #
- Initialize the PiFace library
- p.init()
- #
- Specify the output pin
- that the LED connects to on the
- PiFace
- led =
- 0
- # Turn the LED on
- -
- the value 1, or True, represents on and the
- #
- value 0, or False, represents off.
- p.
- digital_write
- (led, 1)
- # Leave the LED on for 5 seconds
- time.sleep(5)
- # Turn the LED off
- p.
- digital_write
- (led, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement