Hi guys! I happened to be the center of a project.
But I'm not good at coding. To be honest, it's my first time being the main.
I'm going to make this.
Why don't we stop at Red Light during rush hour? It's annoying, right?
We thought of a way to solve this.
You use an ultrasonic sensor to control the LEDs.
Usually, the signal changes according to the routine you set.
When red light (other traffic lights are green light)
When the ultrasonic sensor is detected (this ultrasonic sensor is located in front of a specific distance traffic light).
Five seconds later, it turns greenlight, and the other lights turn red light three seconds later (before it changes to greenlight).
If the light connected to the ultrasonic sensor is detected when the light is greenlight, then the signal is extended.
In other words,
There are three traffic lights, one of them is connected to the ultrasonic sensor.
The period of the traffic light changes to green light after 10 seconds. Greenlight is five seconds long.
But at the light with the ultrasound,
When red light is detected by the ultrasonic sensor,
Red light becomes green light in 3 seconds regardless of the existing cycle.
If it is green light, it is extended by 5 seconds regardless of the existing cycle.
Is it possible to code like this? Can you upload the code?