Example #1
0
def main():
    global wsensor

    blue.low()  # turn on to signal start

    wsensor = analog("water", threshold=450, precision=10, on_change=light_up_blue)

    time.sleep(0.5)

    blue.high()  # turn off

    run(60)
Example #2
0
def main():
    global wsensor

    blue.low() # turn on to signal start

    mqtt("192.168.43.1", "pipe07/wsens01")
    wsensor=analog("water",threshold=450, precision=10, on_change=light_up_blue)

    time.sleep(0.5)

    blue.high() # turn off

    run(60)
Example #3
0
def light_up_blue(t):
    if t.value() == 1:
        blue.low()
        do_later(2, test_turn_led, id="blue_off")