Free
8 min

Traffic Light 04 — Auto-Cycling Both Directions

traffic-lighttimerTONsequencessafety
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_ON

Master power enable

BOOL · %I0.0

Outputs

NS_RED

North-South red lamp

BOOL · %Q0.0

NS_YEL

North-South yellow lamp

BOOL · %Q0.1

NS_GRN

North-South green lamp

BOOL · %Q0.2

EW_RED

East-West red lamp

BOOL · %Q0.3

EW_YEL

East-West yellow lamp

BOOL · %Q0.4

EW_GRN

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

  1. #1NS and EW alternate, and the cycle repeats

    NS green, then EW green, then NS green again one full cycle later

  2. #2NS and EW are never both green

    Safety check at each phase checkpoint across a full cycle

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