← Back to all lessons

Traffic Lights

Recommended before this lesson:

Blink an LED ↗

Your objective

Translations are draft and need educator review.

    Drag blocks from the toolbox into the workspace. Connect statement blocks beneath Start. Use the zoom controls to see your program.

    Loading workspace…

    Local Storage Only
    Saved on this browser only. Cloud project storage is not configured in this environment.

    Ready

    Run and follow this lesson’s rubric and hints. Completion requires observed behavior in one finished run.

    Stop ends the current run and keeps the current device state. Reset clears the device and output, keeping blocks.

    Virtual Traffic Lights

    Three virtual signals with red, yellow and green LED illustrations. Teaching GPIO assumptions: 2 / 4 / 16; board compatibility unverified.

    Red · LED 1: OFF

    Yellow · LED 3: OFF

    Green · LED 2: OFF

    0 ms

    Execution output

      Read-only code preview

      Connect one Start and all supported blocks with valid values to preview or run.

      Editor keyboard and screen reader access has not been verified. The surrounding instructions and controls are keyboard accessible. Practical alternatives: run the preloaded starter program, import/export workspace JSON, or inspect the read-only JavaScript, MicroPython, and C++ code preview.