After you’ve wired up your Arduino, you still need to program it. This chapter provides a basic introduction to programming principles. You’ll check out the features of the Arduino development environment. Next, you’ll explore a basic Arduino sketch in detail, learning about its various functions and commands. This chapter also covers intermediate programming techniques, such as debugging and adapting code. Finally, we’ll add an ultrasonic sensor to our Cruiser robot (see Figure 6.1) and program it to react to an object that it detects.