This chapter describes how to remotely control robot movement. Techniques for sending Serial commands as well as TV type infrared remote control are both explained. The example sketches enable you to command the robot to perform any of the higher level drive functions described in Chapter 7.
The TV remote control sketch requires an infrared decoder module. TSOP4838 (or the equivalent PNA4602) modules (Figure 11-1) have power and signal pins oriented to enable them to plug directly into the socket on the motor shield.
You will also need an infrared remote control—almost any controller from a TV or DVD player will do.
Figure 11-1. Infrared Decoder Module
myRobotSerialRemote.ino—enables the robot to be controlled by
commands from the serial port.
myRobotRemote.ino - uses commands from a TV type remote to
control the robot.
Figure 11-2 shows the modules used in this chapter.
Figure 11-2. Remote Control sketches
The code to handle remote control functions is contained in a module named Remote that appears as a tab in sketches introduced in this chapter. This module:
Defines constants that identify each command.
Matches received data to a command.
Executes a function associated with each command ...