Chapter 1. Hello Arduino
Listing 1.1. Code required to make an LED blink
Listing 1.2. The setup function
Listing 1.3. An example loop function that blinks an LED on and off
Chapter 2. Digital input and output
Listing 2.1. Five flashing LEDs, flashing after each other
Chapter 3. Simple projects: input and output
Listing 3.1. Reading a potentiometer
Listing 3.2. Threshold for a piezoelectric transducer
Chapter 4. Extending Arduino
Listing 4.1. Using the SoftwareSerial library with two ports
Chapter 5. Arduino in motion
Listing 5.1. Sketch to turn a small DC motor on or off
Listing 5.2. Using an L293D to control a small DC motor
Listing 5.3. Controlling motor speed with an L293D
Listing 5.4. Sketch to drive a stepper motor
Listing 5.5. Sketch to rotate a servomotor between 0 and 180 degrees
Listing 5.6. Sketch to control a brushless motor in one direction
Listing 5.7. Sketch to use with ESC that can control speed and direction
Listing 5.8. Sketch to control a brushless motor in both forward and reverse
Chapter 6. Object detection
Listing 6.1. Reading ranges with the Parallax Ping
Listing 6.2. Reading distances with the SRF05
Chapter 7. LCD displays
Chapter 8. Communications
Listing 8.1. Arduino web server
Listing 8.2. Twitter button-press tweeter
Listing 8.3. Arduino accelerometer client
Listing 8.4. Processing sketch to request accelerometer data from Arduino server
Listing 8.5. Bluetooth test sketch
Listing 8.6. SPI digital potentiometer LED dimmer
Chapter 9. Game on
Chapter 10. Integrating the Arduino with iOS
Listing 10.1. ViewController.h
Listing 10.2. ViewController.m
Listing 10.3. Switching LED from iOS device
Listing 10.4. ViewController.h
Listing 10.5. ViewController.m
Listing 10.6. Sketch for iOS Slider control
Listing 10.7. ViewController.h
Chapter 11. Making wearables
Chapter 12. Adding shields
Chapter 13. Software integration
Listing 13.1. Face tracking using OpenCV in Arduino
Listing 13.2. Face tracking in Processing
Listing 13.3. Using Firmata in Processing
Listing 13.4. Pd application as text (AIA13_4.pd)
Listing 13.5. Application to communicate with Pd
Listing 13.6. Arduino application to send temperature data to Python
Listing 13.7. Python application to receive temperature data
Appendix B. Coding primer
Listing B.1. Value of the variable pinLED
Listing B.2. Global and local variables within a sketch
Listing B.3. The switch-case statement
Listing B.4. A for loop printing the value of i, from 0 to 99
Listing B.5. A while loop that prints out the value of i from 0 to 99
Appendix C. Libraries