a guest Apr 20th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- import time
- import RPi.GPIO
- # Initializing the GPIO pins. The numbering using is board.
- # Configuring the GPIO pin number 8 to be an output pin.
- RPi.GPIO.setup(8, RPi.GPIO.OUT)
- print("Running Motor.")
- # Running the motor by changing the GPIO output pin state to high.
- RPi.GPIO.output(8, RPi.GPIO.HIGH)
- # Leave the motor running for 3 seconds.
- # Stop the motor by changing the GPIO output pin state back to low.
- RPi.GPIO.output(8, RPi.GPIO.LOW)
- # cleanup all GPIO pins.
- print("Clean Up GPIO.")
RAW Paste Data