O'Reilly logo

Make an Arduino-Controlled Robot by Michael Margolis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. Remote Control

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.

Hardware Required

  • 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.

Infrared Decoder Module

Figure 11-1. Infrared Decoder Module

Sketches Used in This Chapter

  • 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.

Remote Control sketches

Figure 11-2. Remote Control sketches

Design of the Remote Control Code

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required