M5Stack Traffic Light
A traffic light toy build by M5Stack.
Find the traffic light sequence definition in TrafficLight.ino
. Customize the sequence in lights
array.
// Traffic light struct
typedef struct
{
int color_index; // 1 - Red, 2 - Yellow, 3 - Green
bool turn_left;
bool blink;
unsigned long interval; // milliseconds
} Traffic_Light;
// Traffic light sequences
Traffic_Light lights[] = {
{3, false, false, 30999},
{3, true, true, 30999},
{2, true, true, 10999},
{1, false, false, 30999},
{1, false, true, 10999}};