Skip to content
Parallax Learn

Parallax Learn

  • Welcome
  • Tutorials
        • Tutorial Series head tag

          Tutorial Series
        • Tutorial Series

          The special, classroom-ready series pages are organized collections of tutorials for our most popular hardware and/or languages. The tutorials for each topic are conveniently accessible from a single page, shown in the order it is recommended that they be completed.
        • Robotics Series Head tag

          Robotics Series
        • Robotics Series

          • Artificial Intelligence
          • Cybersecurity: Radio Data tutorialCybersecurity
          • cyber:bot + Python
          • cyber:bot + MakeCode
          • Boe-Bot Tutorial SeriesBoe-Bot
          • Arduino Shield-Bot
          • ActivityBot with C TutorialsActivityBot + C
          • ActivityBot with BlocklyProp Tutorial SeriesActivityBot + BlocklyProp
          • Scribbler 3 Tutorial SeriesScribbler 3
        • Electronics & Programming Series Head tag

          Electronics & Programming Series
          • BS2 Board of Education Tutorial SeriesBS2 Board of Education
          • Propeller C-Language BasicsPropeller C Basics
          • FLiP Try-It Kit C Tutorial SeriesFLiP Try-It Kit + C
          • FLiP Try-It Kit BlocklyProp TutorialsFLiP Try-It Kit + BlocklyProp
          • Badge WX Tutorial SeriesBadge WX
          • Propeller BlocklyProp Basics and ProjectsPropeller BlocklyProp Basics
          • View All Tutorial Series »
        • Browse Tutorials
        • Browse Tutorials

          Individual tutorials sorted by robot or kit, and language.
        • By Robot or Kit
          • ActivityBot
          • SumoBot WX
          • Boe-Bot
          • Shield-Bot
          • cyber:bot
          • Badge WX
          • ELEV-8
          • ARLO
        • By Language
        • By Language

          • Propeller C
          • Arduino
          • BlocklyProp
          • PBASIC
          • Python
          • MakeCode
          • View All Tutorials »
  • Educators
  • Reference
  • Downloads
  • Home
  • All Courses

Arlo with an Arduino Uno & BOE Shield Brain

Curriculum

  • 1 Section
  • 14 Lessons
  • Lifetime
Expand all sectionsCollapse all sections
  • Arlo with an Arduino Uno & BOE Shield Brain
    14
    • 1.1
      ArloRobot Arduino Library
    • 1.2
      Connect BOE Shield to DHB-10
    • 1.3
      Test Shield Electrical Connections
    • 1.4
      Clear the Arduino Sketch
    • 1.5
      Test Arduino to DHB-10 Communication
    • 1.6
      Test BOE Shield Arlo Motor Connections
    • 1.7
      Test BOE Shield Arlo Encoder Connections
    • 1.8
      Try & Tune Some BOE Shield-Bot Code
    • 1.9
      Increase BOE Shield Arlo’s Top Speed
    • 1.10
      Control BOE Shield Arlo with the Terminal
    • 1.11
      More Precise BOE Shield Maneuvers with Encoders
    • 1.12
      Connect & Test BOE Shield + Arlo Ping))) Sensors
    • 1.13
      BOE Shield + Arlo Control System Adjustments
    • 1.14
      Troubleshooting Your Arlo + BOE Shield

Try & Tune Some BOE Shield-Bot Code

Try & Tune Some BOE Shield-Bot Code

Try the Unmodified Code

Let’s try the ForwardLeftRightBackward.ino sketch from https://learn.parallax.com/node/219 in Robotics with the BOE Shield-Bot web book.  You might have noticed that the second to last call in the previous sketch: Arlo.writePulseMode().. That switched the Arlo’s DHB-10 from serial communication mode to pulse mode in preparation for this sketch.  When the Arlo’s DHB-10 starts up, it automatically goes into pulse mode.  So, another option for switching a sketch out of serial communication mode is to simply restart the DHB-10.  You can do that by either pressing and releasing its reset button or turning Motors power off and back on.  

  • Set power like this: MAIN (on), MOTORS (off), BOE Shield (position-2)
  • Upload ForwardLeftRightBackward.ino.
  • Turn all power off, unplug the programming cable, and take to your Arlo to the navigation area.
  • Press and hold the RST button on your BOE Shield.
  • Turn MAIN and MOTORS power on.
  • Let go of the RST button and quickly set the BOE Shield power switch to 2 (you will only have a couple of seconds to do this).
  • Verify that the Arlo goes forward, turns left, then right, then backs up to near where it started.

The sketch would make a BOE Shield-Bot turn about 90 degrees, but not so with the Arlo. 

  • Make notes on how far it actually turned.
  • Let’s say the Arlo turned 60° instead of 90°.  Since (90/60) x 600 = 900 try replacing the 600ms delay with 900 and retry.  A couple iterations to get closer to 90° will probably be needed.  

In the More Precise Maneuvers with Encoders section, we’ll get those 90° turns on the first try! 

// Robotics with the BOE Shield - ForwardLeftRightBackward
// Move forward, left, right, then backward for testing and tuning.

#include <Servo.h>                           // Include servo library

Servo servoLeft;                             // Declare left and right servos
Servo servoRight;

void setup()                                 // Built-in initialization block
{
  tone(4, 3000, 1000);                       // Play tone for 1 second
  delay(1000);                               // Delay to finish tone

  servoLeft.attach(13);                      // Attach left signal to pin 13
  servoRight.attach(12);                     // Attach right signal to pin 12

  // Full speed forward
  servoLeft.writeMicroseconds(1700);         // Left wheel counterclockwise
  servoRight.writeMicroseconds(1300);        // Right wheel clockwise
  delay(2000);                               // ...for 2 seconds

  // Turn left in place
  servoLeft.writeMicroseconds(1300);         // Left wheel clockwise
  servoRight.writeMicroseconds(1300);        // Right wheel clockwise
  delay(600);                                // ...for 0.6 seconds

  // Turn right in place
  servoLeft.writeMicroseconds(1700);         // Left wheel counterclockwise
  servoRight.writeMicroseconds(1700);        // Right wheel counterclockwise
  delay(600);                                // ...for 0.6 seconds

  // Full speed backward
  servoLeft.writeMicroseconds(1300);         // Left wheel clockwise
  servoRight.writeMicroseconds(1700);        // Right wheel counterclockwise
  delay(2000);                               // ...for 2 seconds

  servoLeft.detach();                        // Stop sending servo signals
  servoRight.detach();
}  

void loop()                                  // Main loop auto-repeats
{                                            // Empty, nothing needs repeating
}

Printer-friendly version
Test BOE Shield Arlo Encoder Connections
Prev
Increase BOE Shield Arlo’s Top Speed
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

About | Terms of Use | Feedback: learn@parallax.com | Copyright©Parallax Inc. 2024

© 2026 Parallax Learn • Built with GeneratePress