Sequencing

Traffic Light 2-Way

medium

Cycles a two-direction intersection with an all-red safety phase before traffic changes direction.

What it teaches

Keeps Traffic Light Simple’s Enable control, then adds coordination between two directions. The new lesson is the all-red interlock: both directions must close before the other opens.

Inputs and outputs

TagTypeDefaultDescription
In_EnableBOOL1 runs the cycle; 0 resets it and shows red in both directions
Cfg_GreenTimeDINT3000Duration of each green phase in milliseconds
Cfg_AmberTimeDINT1500Duration of each amber phase in milliseconds
Cfg_AllRedTimeDINT2000Duration of each all-red safety phase in milliseconds
Out_NSGreenBOOLNorth-south green light
Out_NSAmberBOOLNorth-south amber light
Out_NSRedBOOLNorth-south red light
Out_EWGreenBOOLEast-west green light
Out_EWAmberBOOLEast-west amber light
Out_EWRedBOOLEast-west red light

Required behavior