Example Code for micro:bit-Traffic Signal Light
Last revision 2026/01/14
This article provides a step-by-step guide on using micro:bit to create a traffic signal light, complete with example code, hardware setup, and additional resources for educators and beginners.
Software Preparation
- Enter the MakeCode programming platform in browser: https://makecode.microbit.org/
- Create a new project and name it.
- Load in the program library of xia_mi board: click “setting”, and “expansion” in turn, then paste this link in the search box: https://github.com/DFRobot/pxt-DFRobot_xia_mi_Board.
Sample Code
MakeCode Program Link: https://makecode.microbit.org/_RduW652MPKyk

Was this article helpful?
