Test BOE Shield Arlo Motor Connections

Test Motor Connections

This next sketch sets the Arlo’s motors to 20/127 of full power in the forward direction.  If your Arlo goes forward while running this sketch, it indicates that your motors are connected correctly and the battery is charged.

IMPORTANT: Your Arlo will not be ready for the next step until it goes forward for this test.

  • Check the picture at the start of this document and make sure you know the Arlo’s forward, backward, left and right.
  • Turn off the Arlo’s Motors power switch.
  • Upload Arlo-Test-Motor-Connections.ino.
  • The Terminal will display a communication failure because your DHB-10 isn’t responding.  Don’t worry about it, the DHB-10 didn’t reply because Motors power is off.
  • Turn all power switches off.
  • Take your Arlo to an open space with at least 2 m of open space for forward travel.
  • Turn all powers on: Arlo MAIN & MOTORS and BOE Shield power to 2. Press the reset button once.
  • Verify that the Arlo goes slowly forward for 3 s, then stops.
    • If it does not go forward, check the Arlo Fails Motor Connections Test section in the Troubleshooting Guide at the end of this document.
    • If it does go forward, your Arlo is ready for the next step (Test Encoder Connections).
/*
Arlo-Test-Motor-Connections
Run this sketch to verify that your Arlo goes forward.
*/

#include <ArloRobot.h>                       // Include Arlo library
#include <SoftwareSerial.h>                  // Include SoftwareSerial library

ArloRobot Arlo;                              // Declare Arlo object
SoftwareSerial ArloSerial(12, 13);           // Declare SoftwareSerial object

                                             // DHB-10 -> I/O 12, DHB-10 <- I/O 13

void setup()                                 // Setup function

{
 tone(4, 3000, 2000);                        // Piezospeaker beep
 Serial.begin(9600);                         // Start terminal serial port

 ArloSerial.begin(19200);                    // Start DHB-10 serial communication
 Arlo.begin(ArloSerial);                     // Pass to Arlo object

 Arlo.writeMotorPower(20, 20);               // Go forward very slowly
 delay(3000);                                //   for three seconds
 Arlo.writeMotorPower(0, 0);                 //   then stop
}

void loop() {}                                // Nothing for main loop