Cover 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

O'Reilly logo

Chapter 6. Testing the Robot's Basic Functions

In this chapter, you will upload a test sketch to the robot that will verify that your robot is working correctly.

Hardware Required

  • The assembled robot chassis.

  • Motors connected to shield (see Figure 3-25 for 2WD or Figure 4-26 for 4WD).

  • Example code and libraries installed, see Installing Third-Party Libraries.

  • 5 AA cells inserted into the battery holder (USB does not provide sufficient power to drive the motors).

  • Reflectance sensors mounted and connected (left sensor to analog input 0, right to analog 1). You can use the stripboard wiring described in Making a Line Sensor Mount. But to run the edge detecting project described in Chapter 9, you need more space between the sensors.

Figure 6-1 shows the assembled two wheel robot; Figure 6-2 shows the assembled four wheel robot. Figure 6-3 shows the sensor and motor connections.

Reflectance sensor connections

Figure 6-3. Reflectance sensor connections

Software Prerequisites

Although the sketch code used in this chapter is printed in the pages that follow, you will need some libraries that are included in example ...

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