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
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.