Guest User

Untitled

a guest
Feb 9th, 2022
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1.  
  2.      
  3. #import libraries
  4. import time
  5. import RPi.GPIO as GPIO
  6. import subprocess
  7.  
  8. GPIO.setmode(GPIO.BOARD)
  9. GPIO.setup(37,GPIO.OUT)  #pump
  10. GPIO.setup(32,GPIO.OUT) #enable soil sensor
  11.  
  12.  
  13. try:
  14.     GPIO.output(37, True)
  15.     GPIO.output(32, True)
  16.     time.sleep(5)
  17.     GPIO.output(37, False)
  18.     GPIO.output(32, False)
  19.  
  20. finally:
  21.     GPIO.cleanup()
Advertisement
Add Comment
Please, Sign In to add comment