Advertisement
simonedare_

Untitled

Dec 12th, 2023
513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. from gpiozero import OutputDevice
  2. # setup PIN as output
  3. gpio_pin = OutputDevice(18, initial_value=True)
  4. # change GPIO status
  5. gpio_pin.toggle()
  6. # wait 40 seconds
  7. time.sleep(40)
  8. # change GPIO status to stop the movement
  9. gpio_pin.toggle()
  10. # close the pin, clear the status
  11. gpio_pin.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement