← All exercises

Traffic Light Simple

medium

Simple traffic light sequencer cycling through Red, Green, and Amber phases.

What it teaches

Move through a fixed sequence of phases — red, then green, then amber, then back to red — each held for a set time. One repeating timer paces the whole cycle, and you light each output by comparing the elapsed time against that phase's cutoff. The skeleton behind every wash cycle, batch process, and motion routine.

Inputs and outputs

TagTypeDefaultDescription
In_EnableBOOL1
Cfg_RedTimeDINT5000
Cfg_GreenTimeDINT5000
Cfg_AmberTimeDINT2000
Out_RedBOOL
Out_GreenBOOL
Out_AmberBOOL

Required behavior