انتقل للمحتوى
Robo EgyptRobo Egypt
☰ Course contents
Robo Maker: home
0. Lab tour1
1. The start: the Arduino6
2. Wiring and the traffic light4
3. Inputs: the button4
4. Sound and movement5
5. Sensors and numbers5
6. Distance, the screen and colours5
7. Motors and the car4
8. The project: the city's smart gate3
9. From blocks to C++ code5
10. Sensors and screens in code5
11. Smart systems5
12. Bluetooth: control from the phone1

A button and a buzzer

Section 3: Inputs: the buttonLesson 3.2 · ⏱ 7 min
🧩 A button and a buzzer
Blocks: loop — repeats forever
🖥️ What happens on the stage?
When you press the button the buzzer plays, and when you let go it stops.

📌 Another example: a two-note bell

The button plays two notes: “ding dong”.

🧩 A two-note bell
Blocks: loop — repeats forever
Ding dong
Ding dong
✍️ Practise
Build the button and the buzzer.
✍️ Practise here in the lessonor open the lab in a new page ↗
✍️ Practise
Fix one mistake: the button doesn't work.
✍️ Practise here in the lessonor open the lab in a new page ↗

🎯 Challenge yourself

Easy

The button plays the note A4.

👀 Show the solution
🧩 Solution
Blocks: loop — repeats forever
In the lab
In the lab

Result: the note A4 (440).

Medium

Not pressed: silent. Pressed: a beeper (a note, then silence, repeating).

👀 Show the solution
🧩 Solution
Blocks: loop — repeats forever
In the lab
In the lab

Result: a broken beeping.

Hard

An alarm: when pressed, two notes take turns (high and low).

👀 Show the solution
🧩 Solution
Blocks: loop — repeats forever
In the lab
In the lab

Result: two notes taking turns.

Finished the lesson? Mark it so your progress counts.