Haven't expanded beyond a starter kit (LEDs, resistors, push buttons, photo resistors) yet, had completed all of the starters included in the inventr.io PDF and wanted to challenge myself a bit more. I used the Traffic Lights example as a rough template and wrote it entirely. This is the first project I wrote from a blank Arduino template!
This would be much more visually appealing on 2 seprate breadboards I think!
I am sure the code could be cleaned up with some arrays or something I will get there eventually!
EXPANDED TECHNICAL DETAILS
Distributed State-Machine Logic
This foundational project replicates the complex synchronization found in multi-intersection urban traffic control systems.
- Parallel Sequential Loops: The Arduino manages two or more sets of R/G/Y LEDs. The firmware uses an advanced
millis()based state machine that accounts for "Green-Wave" timing, where both lights are coordinated to improve the flow of simulated traffic. - Manual Pedestrian Interrupt: Features a "Crosswalk" button. When pressed, the Arduino safely interrupts the current cycle, ensuring a 2-second "All-Red" buffer before allowing the pedestrian to cross.
Visualization
- 10mm Industrial Indicator LEDs: Uses high-brightness LEDs that mimic real-world traffic signals, with the firmware implementing a "Fade-In/Out" effect on the yellow light for added realism.