Hello Everyone ,
I have a breadboard, microcontroller, LEDs, and push buttons, and I'm interested in creating a two-way traffic light system for an experimental project. I have already designed a diagram for vehicle and pedestrian crossings.

Here are the simplified rules for both vehicles and pedestrians:
Rules for Vehicles:
Rules for Pedestrians:
For the traffic light system:
I'm facing some challenges in designing the logic for the pedestrian signal timing in traffic light system. Specifically, I'm finding it difficult to determine when and how much time should be allocated for pedestrian crossing.
I would greatly appreciate any suggestions you can provide to help me create a safe timing sequence for pedestrians.
Thank you for your any suggestion
I have a breadboard, microcontroller, LEDs, and push buttons, and I'm interested in creating a two-way traffic light system for an experimental project. I have already designed a diagram for vehicle and pedestrian crossings.

Here are the simplified rules for both vehicles and pedestrians:
Rules for Vehicles:
- Red Light (Stop):
- When the traffic signal is red for eastbound or westbound vehicles.
- All vehicles in those lanes must come to a complete stop.
- Green Light (Go):
- When the traffic signal is green for eastbound or westbound vehicles:
- Vehicles in those lanes can go.
- Yellow Light (Prepare to Stop):
- When the traffic signal changes from green to yellow for eastbound or westbound vehicles:
- Vehicles should prepare to stop as the signal is about to turn red.
Rules for Pedestrians:
- Blue Light (Walk):
- When the pedestrian signal is blue for northbound or southbound pedestrians:
- Pedestrians can cross.
- Red Light (Stop):
- When the pedestrian signal is red for northbound or southbound pedestrians:
- Pedestrians must not cross.
For the traffic light system:
- The red LED should be active for 20 seconds.
- The green LED should also be active for 20 seconds.
- A 3-second interval is allocated for the yellow LED.
- The blue LED will be active for 20 seconds.
I'm facing some challenges in designing the logic for the pedestrian signal timing in traffic light system. Specifically, I'm finding it difficult to determine when and how much time should be allocated for pedestrian crossing.
I would greatly appreciate any suggestions you can provide to help me create a safe timing sequence for pedestrians.
Thank you for your any suggestion