Note:The sensors, modules and the 270° servo in each project are shared.

Project 02: Sound of Traffic Lights

Img

1. Introduction

Today, I was walking home from school when I saw the traffic light beep at the intersection. Can we add a sound to the traffic light module in project 01? Let’s take a look at the tools first.

2. Components

Img

Img

Img

Kidsuno Mainboard×1

Traffic Light Module×1

Active Buzzer×1

Img

Img

Img

Connection Wire×2

USB Cable×1

Sound of Traffic Light×1

Img

3. Assembly Steps

Download the PDF follow the link:Sound of Traffic Lights Assembly

Or you can Watch the assemble video :

4. Function: Make the Active Buzzer Sound

Img

5. Wiring Diagram

Connect the mainboard and computer via a USB cable, and connect the traffic light module to the No.1 interface of the mainboard and the active buzzer to the No.9 interface of the mainboard.

Img

6. Write the Program

① Drag the instruction blockImg in the Events module to the script area.

Img

② Drag the instruction block Img in the Pins module to the script area. Since the interface of the active buzzer module is connected to the D10 pin of interface 9 on the mainboard, then change the number 0 to 10 and the input to output.

Img

③ Drag the instruction blockImg in the Pins module to the script area and change the number 0 to 10.

Img

④ Complete Program

Img

7. Test Result

Click Img to upload the complete program to the kidsuno mainboard and power up, then the active buzzer will sound. It seems pretty amazing, right?

Img

8. Function: Make the Active Buzzer Beep

Img

9. Write the Program

① change the high in the previous program to low.

Img

② Drag the instruction blockImg in the “Control” module to the script area.

Img

③ Drag the instruction blockImg in the Pins module to the script area and change the number 0 to 10.

Img

④ Drag the instruction blockImg in the Control module to the script area. The number 1 can be changed to other numbers. Here, the number 0.5 is taken as an example.

Img

⑤ Copy the code stringImg once and change high to low .

Img

⑥ Complete Program

Img

10. Test Result

Click Img to upload the complete program to the kidsuno mainboard and power up, then the active buzzer will beep. It seems pretty amazing, right?

Img

11. Function: Sound of Traffic Lights

Img

12. Flow Chart

First the three LED lights will be off the buzzer will not beep, then the buzzer beeps and the red light flashes for 5 s then goes off , then the yellow light flashes for 3 times then goes off, then the green light will be on for 5 s then go off.

Img

13. Write the Program

① Find the instruction blocks

(1)Img

(2)Img

(3)Img

② Complete Program

Img

14. Test Result

Click Img to upload the complete program to the kidsuno mainboard and power up, then the buzzer beeps and the red light flashes for 5 s then it won’t beep and the light will be off , then the yellow light flashes for 3 times then goes off, then the green light will be on for 5 s then go off.

Img

15. Extended Project

Img

The sample code is below:

Img