Esempio n. 1
0
    def initialize(self):
        Context.initialize()

        if not self.check_early_stop():
            Context.DAY, Context.TIME = datetime.datetime.today().strftime(
                '%Y-%m-%d %H:%M:%S').split()
            # Initialize water sensor
            GPIO.setmode(GPIO.BCM)
            GPIO.setup(Context.water_sensor, GPIO.OUT)
            GPIO.output(Context.water_sensor, GPIO.LOW)
            sleep(0.05)
            GPIO.setup(Context.water_sensor, GPIO.IN)

            lprint("initialized")
Esempio n. 2
0
def demo_pumps(pumps, duration=0.5):
    ctx = Context()
    Context.initialize()
    ctx.run_pump(pumps, duration=duration)