Chapter 8
Challenge 2: Examining the Software
Now that you have your Arduino flashlight built, it’s time to create the sketch that will be uploaded to the Arduino so you can actually use it. A flashlight is a fairly simple device, and the sketch is fairly simple, too—we’ll go over the entire sketch in this chapter. And guess what? Even though your Challenge #2 gizmo has only one LED, you can easily add more. That’s the benefit of using an Arduino to power the LEDs. If you find that your flashlight isn’t bright enough, just add another LED!
As you saw in Chapter 7, each LED has a resistor that helps protect it from receiving too much current (it also protects the Arduino as it can only source 24 milliamperes). Also, each LED can be connected ...
Get Arduino Adventures: Escape from Gemini Station now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.