Chapter 8. DJ Raspi
In this chapter, you’ll be
- Giving your Pi the ability to respond to input signals by making it interact with you in response to button presses
- Learning about electronic buttons and how to build circuits on a breadboard with them
- Running Raspbian operating system commands so your programs can play music, show videos, and more
- Using Python to store sets of information called lists
- Exploring how you can play sounds on your Pi and make your Pi into a music machine
We don’t think about our five senses (taste, smell, touch, hearing, and sight), but without them we wouldn’t be able to feel, know, and interact with the world around us. Think of your Pi as a person who, until now, has had a limited set of senses. So far, your Pi has only been able to respond to keyboard keys being pressed and mouse clicks.
Like a mad scientist bringing something to life, in this chapter you’re going to embark on a project to wire up a new sense of touch for your Pi. Okay, maybe it won’t be as crazy as creating a bionic creature, but a button gives your Pi a sense of touch. You’ll wire a couple buttons to the Pi’s GPIO pins (recall that GPIO stands for general-purpose input/output, so this is how your Pi can sense and affect the environment). Then you’ll program your Pi to react to button presses. Exciting times are ahead!