6 Switches, LEDs, and More

In this chapter, you’re going to learn how to make your projects interactive, first by adding a button to turn an LED on and off. Then, you’ll attach a speaker to your Arduino and control both sound and light with your sketch. Finally, you’ll add two more buttons, in the process of building a keyboard instrument on which you can play simple tunes. Throughout these projects, you’ll learn more about programming the Arduino. To complete the projects in this chapter, you need to have the Arduino IDE installed, know how to connect a breadboard to your Arduino, and be familiar with writing a sketch and uploading it to your Arduino.


In Chapter 4, “Programming the Arduino,” you saw how to connect the Arduino ...

Get Learn Electronics with Arduino now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.