# Blink all four LEDs on the YouKnow (and the Uno's built-in pin13 LED)
#
# v1.1   31-Jan-2019 (eric@edushields.com) remove PyMata3 constructor call workarounds
#                      frequently necessary for pre-v2.28 version of pymata-aio
#                    Removed check for __main__ for brevity
# v1.0.2 19-Oct-2018 (eric@edushields.com)
#                    remove the two injected backslashes from bad copy-and-paste
#                    add arduino_wait=3 to PyMata3() call because the current default of 2
#                      (seconds) for an Uno is not always enough                
# v1.0.1 11-Oct-2018 (eric@edushields.com) Updated header comment block for use in ME30 Lab7
# v1.0   12-Jan-2018 (eric@edushields.com) Initial version
#
from pymata_aio.pymata3 import PyMata3
from youknow            import Led, PIN_LED0, PIN_LED1, PIN_LED2, PIN_LED3

PIN_LED_BUILTIN = 13

board = PyMata3()

leds = ( Led(board, PIN_LED0),
         Led(board, PIN_LED1),
         Led(board, PIN_LED2),
         Led(board, PIN_LED3),
         Led(board, PIN_LED_BUILTIN) )

while True:
    for led in leds:
        led.on()

    board.sleep(0.5)

    for led in leds:
        led.off()

    board.sleep(0.5)
