2
Digital Inputs, Outputs, and Pulse-Width Modulation
What You'll Need for This Chapter:
- Arduino Uno or Adafruit METRO 328
- USB cable (Type A to B for Uno, Type A to Micro-B for METRO)
- Half-size or full-size breadboard
- Assorted jumper wires
- Pushbutton
- 220Ω resistors (×3)
- 10kΩ resistor
- 5mm red LED
- 5mm common-anode RGB LED
- CODE AND DIGITAL CONTENT FOR THIS CHAPTER
- Code downloads, videos, and other digital content for this chapter can be found at:
exploringarduino.com/content2/ch2
- Code for this chapter can also be obtained from the Downloads tab on this book's Wiley web page:
wiley.com/go/exploringarduino2e
Blinking an LED is great, as you learned in the preceding chapter, but what makes the Arduino microcontroller platform so useful is that the system is equipped with both inputs and outputs. By combining both, your opportunities are nearly limitless. For example, you can use a magnetic reed switch to play music when your door opens, create an electronic lockbox...