What’s the code in this sketch? Here’s the code for the ATG5_Button sketch. We’ll step through the details over the next few pages. (We’ve removed the code’s starting comments for the sake of brevity.) Initializing our code and variables ATG5_Button is different from our ATG3_Blink sketch in that there is code that happens before the […]

Read More →

Digital input: what is it again? Let’s say that you’re standing outside a friend’s house looking through the window at a light switch. Your friend calls to ask “Is the light switch on?” Your job is to tell the friend “yes the light switch is on” or “no, the light switch is off.” That’s exactly […]

Read More →

Adding a second button We are going to add another button to our circuit so we can play a 2 note tune on our mini-keyboard instrument. We will need another button, another 10 K ohm resistor and more jumpers. Remember to unplug your Arduino from your computer before you add to the circuit. Parts to […]

Read More →

Build the circuit step by step In order to build the basic circuit described in this chapter, you’ll need the following parts. You’ll need these parts: 2 red LEDs 1 220 ohm resistor (red, red, brown, gold) Jumper wires Breadboard. Arduino Uno USB A-B cable Computer with Arduino IDE This circuit is quite similar to […]

Read More →