image thumbnail

Traffic Light on Arduino using Stateflow

version (834 KB) by Techsource Technical Team
Model a traffic light switching sequence using Stateflow


Updated 12 Aug 2015

View License

This project models a traffic light switching sequence, where the switching sequence is automated as follows:
Red (5 sec) > Amber (2 sec) > Green (5 sec)
The code initializes first by blinking all three LEDs three times, and then proceeds with the traffic light sequence.
In the model, a Stateflow chart is used for the logical modelling.

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

Cite As

Techsource Technical Team (2022). Traffic Light on Arduino using Stateflow (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: Traffic Light + Switch on Arduino

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!