File Exchange

image thumbnail

Traffic Light + Switch on Arduino

version 1.0 (853 KB) by

Have automated and manual modes for traffic light switching. Change anytime between the two modes!



View License

This project is an extension to the “Traffic Light on Arduino using Stateflow” project. In addition to modeling the switching of traffic lights, there are two modes: automated and manual. A Stateflow chart is used to create state machines for the automated and manual mode.
Automates the switching sequence when the push button is held down for more than 1.5 seconds. Red (5 sec) > Amber (2 sec) > Green (5 sec).
Changes the light each time the button is pressed.
Transition from Manual to Automated mode:
At any time within manual mode, if the pushbutton is held down for longer than 1.5 seconds, the mode will change to automated. The sequence will restart: Red > Amber > Green, even though the light may have been at amber or green at the point of change.

Transition from Automated to Manual mode:
At any time within automated mode, if the pushbutton is pressed, the mode will change to manual.

Adapted from Simon Monk's "30 Arduino Projects for the Evil Genius".

Comments and Ratings (0)



Updated description.


Added picture

MATLAB Release
MATLAB 8.5 (R2015a)

Inspired by: Traffic Light on Arduino using Stateflow


More Files in the  Maker Community

MATLAB Online Live Editor Challenge

Win cash prizes and have your live script featured on our website

Learn more

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video