Traffic Light 04 — Auto-Cycling Both Directions
Ready to build this?
Sign up free — no credit card required. This scenario is included in the free tier.
Sign up to play this scenario →Already have an account? Log in
Briefing
Double the Stage-3 pattern and wire it to loop: North-South cycles green->yellow->red, then East-West gets its turn, then back to North-South, forever. This is everything the capstone does except the all-red safety clearance between direction changes — that nuance is Stage 5's whole point.
Objectives
- North-South cycles green (3s) -> yellow (1s) -> red
- Then East-West cycles green (3s) -> yellow (1s) -> red
- Then back to North-South — the cycle repeats forever
- NS_GRN and EW_GRN are never true at the same time
Hints
- Build two Stage-3 rings (one for NS, one for EW) sharing the same TON/SET-RESET pattern.
- Chain them: NS yellow's timeout SETs EW green; EW yellow's timeout SETs NS green again — that's what makes it repeat.
- Each direction is red whenever its own green/yellow phase bits are both false.
I/O Table
Inputs
POWER_ONMaster power enable
BOOL · %I0.0
Outputs
NS_REDNorth-South red lamp
BOOL · %Q0.0
NS_YELNorth-South yellow lamp
BOOL · %Q0.1
NS_GRNNorth-South green lamp
BOOL · %Q0.2
EW_REDEast-West red lamp
BOOL · %Q0.3
EW_YELEast-West yellow lamp
BOOL · %Q0.4
EW_GRNEast-West green lamp
BOOL · %Q0.5
Your program will be tested against:
All test cases run automatically when you submit. Assertions are hidden until you pass.
- #1NS and EW alternate, and the cycle repeats
NS green, then EW green, then NS green again one full cycle later
- #2NS and EW are never both green
Safety check at each phase checkpoint across a full cycle
Related scenarios
Ready to build this?
Sign up free — no credit card required. This scenario is included in the free tier.
Sign up to play this scenario →Already have an account? Log in