Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import RPi.GPIO as GPIO
- import time as time
- from water_sched import WaterSchedule
- from light_sched import LightSchedule
- from cooling_sched import CoolingSchedule
- from lcd_sched import LCDSchedule
- # initialize schedule objects
- water = WaterSchedule()
- light = LightSchedule()
- cooling = CoolingSchedule()
- # initialize lcd
- lcd = LCDSchedule(water, light, cooling)
- def setup():
- # set up GPIO
- GPIO.setmode(GPIO.BCM)
- GPIO.setwarnings(False)
- # setup schedules
- water.setup()
- light.setup()
- cooling.setup()
- # setup lcd
- lcd.setup()
- def main():
- setup()
- while True:
- water.update()
- time.sleep(3)
- light.update()
- time.sleep(3)
- cooling.update()
- time.sleep(3)
- lcd.update()
- time.sleep(3)
- if __name__ == "__main__":
- main()
Add Comment
Please, Sign In to add comment