from machine import Pin
from utime import sleep
from neopixel import NeoPixel
strip = NeoPixel(Pin(15), 6)
north_light = (0,1,2)
east_light = (3,4,5)
red = (255,0,0)
green = (0,255,0)
amber = (155,55,0)
clear = (0,0,0)
def set_stop(strip, light):
r, a, g = light
strip[r] = clear
strip[a] = amber
strip[g] = clear
strip.write()
sleep(3)
strip[r] = red
strip[a] = clear
strip[g] = clear
strip.write()
def set_go(strip, light):
r,a,g = light
strip[a] = amber
strip.write()
sleep(3)
strip[r] = clear
strip[a] = clear
strip[g] = green
strip.write()
strip[0] = red
strip[3] = red
strip.write()
while True:
sleep(3)
set_go(strip, north_light)
sleep(3)
set_stop(strip, north_light)
sleep(3)
set_go(strip, east_light)
sleep(3)
set_stop(strip, east_light)