← 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.

Parameters

TagDirectionTypeDefaultDescription
In_EnableInputBOOL01 runs the cycle; 0 resets it and shows red in both directions
Cfg_GreenTimeInputDINT3000Duration of each green phase in milliseconds
Cfg_AmberTimeInputDINT1500Duration of each amber phase in milliseconds
Cfg_AllRedTimeInputDINT2000Duration of each all-red safety phase in milliseconds
Out_NSGreenOutputBOOL0North-south green light
Out_NSAmberOutputBOOL0North-south amber light
Out_NSRedOutputBOOL0North-south red light
Out_EWGreenOutputBOOL0East-west green light
Out_EWAmberOutputBOOL0East-west amber light
Out_EWRedOutputBOOL0East-west red light

Required behavior