Guest User

Untitled

a guest
Aug 11th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. import RPi.GPIO as GPIO
  2. import time as time
  3.  
  4. from water_sched import WaterSchedule
  5. from light_sched import LightSchedule
  6. from cooling_sched import CoolingSchedule
  7. from lcd_sched import LCDSchedule
  8.  
  9. # initialize schedule objects
  10. water = WaterSchedule()
  11. light = LightSchedule()
  12. cooling = CoolingSchedule()
  13.  
  14. # initialize lcd
  15. lcd = LCDSchedule(water, light, cooling)
  16.  
  17. def setup():
  18. # set up GPIO
  19. GPIO.setmode(GPIO.BCM)
  20. GPIO.setwarnings(False)
  21.  
  22. # setup schedules
  23. water.setup()
  24. light.setup()
  25. cooling.setup()
  26.  
  27. # setup lcd
  28. lcd.setup()
  29.  
  30. def main():
  31. setup()
  32.  
  33. while True:
  34. water.update()
  35. time.sleep(3)
  36.  
  37. light.update()
  38. time.sleep(3)
  39.  
  40. cooling.update()
  41. time.sleep(3)
  42.  
  43. lcd.update()
  44. time.sleep(3)
  45.  
  46. if __name__ == "__main__":
  47. main()
Add Comment
Please, Sign In to add comment