Question
Create a code for Arduino Uno : Want to simulate a traffic light, using 3 LED's (R,Y,G) and one momentary pushbutton to simulate a pedestrian
Create a code for Arduino Uno: Want to simulate a traffic light, using 3 LED's (R,Y,G) and one momentary pushbutton to simulate a pedestrian wanting to cross the street. Control the LED's in the typical traffic light pattern, but let RED and GREEN stay on for just 30 sec and when using YELLOW, just have it on for 3 sec. When the program starts, start In RED, and for the normal pattern automatically, BUT when a pedestrian hits the pushbutton:
a. If the button is pushed when you are RED, then make sure the pedestrian has 15 sec to walk across before turning GREEN.
b. If the button is pushed when you are GREEN, wait 5 sec and then do your YELLOW and RED.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started