import time
from machine import Pin
print("Hello, Mr Inglese, how was your weekend?")
LedRED = Pin(2,Pin.OUT)
LedORANGE = Pin(3,Pin.OUT)
LedGREEN = Pin(8,Pin.OUT)
myDelay = 0.2
goBackwards = False
while 1:
LedRED.value(1)
time.sleep(myDelay)
LedRED.value(0)
LedORANGE.value(1)
time.sleep(myDelay)
LedORANGE.value(0)
LedGREEN.value(1)
time.sleep(myDelay)
LedGREEN.value(0)
if goBackwards:
myDelay -= 0.05
else:
myDelay += 0.05
if myDelay > 1.0:
goBackwards = True
if myDelay < 0.05:
goBackwards = False
print("MyDelay is",myDelay)