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 Activity Board Brain

Arlo with an Activity Board Brain

Control the Activity Board Arlo with Serial Messages

Control the Activity Board Arlo with Serial Messages

This example uses serial messages to demonstrate how your program can issue the same commands from Control Arlo with the SimpleIDE Terminal with the help of the arlodrive library’s dhb10_com function, this call allows your program to pass a text string to the Arlo’s DHB-10 motor controller, and returns the address of a string that contains the DHB-10’s reply.  Remember, for a full list of serial commands you can use, check the DHB-10 Motor Controller Firmware Guide.

  • Put the Arlo up on a stand so it’s wheels can’t make it move.
  • Set power like this: MAIN (on), MOTORS (on), Activity Board (position-2)
  • Load Serial through arlodrive into the Propeller using SimpleIDE’s Run with Terminal button.
  • Watch the serial message exchanges as the Arlo does its maneuver and reports its distance traveled.
/*
  Arlo - Serial through arlodrive.c
*/

#include "simpletools.h"                      // Include simple tools
#include "arlodrive.h"

char *reply;

int main()                                    // Main function
{
  print("SPEED & DISTANCE\n\n");
  print("To DHB-10         From DHB-10\n");
  print("-------------     ----------------\n");

  print("RST\\r             ");
  reply = dhb10_com("RST\r");
  if(*reply == '\r') print("\\r\n");
  else print("%s", reply);

  print("gospd 32 32\\r     ");
  reply = dhb10_com("gospd 32 32\r");
  if(*reply == '\r') print("\\r\n");
  else print("%s", reply);

  pause(2000);

  print("gospd 0 0\\r       ");
  reply = dhb10_com("gospd 0 0\r");
  if(*reply == '\r') print("\\r\n");
  else print("%s", reply);

  // Display distance reply as text
  print("dist\\r            ");
  reply = dhb10_com("dist\r");
  if(*reply == '\r') print("\\r\n");
  else print("%s", reply);

  print("-------------     ----------------\n");

  // Convert distance reply text to numeric values to use in
  // calculations, and display the results stored by int variables.
  int countLeft, countRight;
  print("\nVARIABLE VALUES\n", reply);
  sscan(reply, "%d%d", &countLeft, &countRight);
  print("countLeft = %d, countright = %d\n", countLeft, countRight);
}

Printer-friendly version
Connect & Test Activity Board Arlo Ping))) Sensors
Prev
Activity Board Arlo Control System Adjustments
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

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

© 2025 Parallax Learn • Built with GeneratePress