Close

CODE

A project log for Traffic Jam

Red light, green light, 1-2-3! Using an Arduino to control giant surplus store traffic lights

Robyn WRobyn W 04/29/2020 at 19:060 Comments

Starting off with writing the code for the traffic lights we had to identify the inputs and outputs. We needed 3 inputs (one for each button) and 6 outputs (3 for the relay modules, 3 for the button lights). In the first version of the code a button press would toggle the corresponding traffic light on or off (yellow to yellow, red to red, green to green). With the 2nd version when a button is pressed, the button light is on while the button is depressed (does not toggle)

Discussions