Traffic ights enable effective traffic control, and have obvious effects on diverting traffic flow, improving road capacity, and reducing traffic accidents. But when there are no pedestrians to pass, the red light will reduce the driving efficiency, so we can make a push-button crosswalk traffic light. When someone needs to cross the road, press the button to triggering the green lights.
Click “Advanced” in the MakeCode drawer to see more choices.
For programming, we need to add a package: click “Extensions” at the bottom of the MakeCode drawer and search with “iot-environment-kit” in the dialogue box to download it.
Notice: If you met a tip indicating that some codebases would be deleted due to incompatibility, you may continue as the tips say or create a new project in the menu.
Press button A to display the countdown time on the micro:bit, press the button to light on the red led for 10s, the yellow for 3s and the green for 5s.