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
  • Propeller C Programming with the ActivityBot 360°

Propeller C Programming with the ActivityBot 360°

Test the Feedback 360° Servos

It’s time to test your Feedback 360° servos’ feedback signal connections, to make sure they are proper working order.  If all is well, the example program below will cause the built-in LED on the Activity Board WX to blink on and off when you gently turn a wheel by hand.  

  • In SimpleIDE, open Test Feedback 360 Servo Connections.side
  • Turn the robot’s PWR switch to Position 2.
  • In SimpleIDE, click the Load EEPROM & Run button.
  • With your hand, gently twist the ActivityBot’s left wheel. This should make the P26 LED turn on and off as you rotate the wheel.
  • Repeat for the right wheel.  Turning the right wheel should make the P27 LED turn on and off.

/*
 Test Feedback Connections.c
*/

                                                                            
#include "simpletools.h"                     // Library - simpletools
#include "abdrive360.h"                      // Library - abdrive360

int left;                                    // Current/previous angles
int right;
int leftPrev;
int rightPrev;

int main()                                   // Main function
{
 drive_getTicks(&left, &right);              // Get current encoder ticks
 leftPrev = left;                            // Set previous values
 rightPrev = right;
 
 while (1)                                   // Main loop
 {
   drive_getTicks(&left, &right);            // Get current encoder ticks
   if (left != leftPrev)                     // If left different from previous
   {
     toggle(26);                             // Toggle P26 LED light
   }

   if (right != rightPrev)                   // If right different from previous
   {
     toggle(27);                             // Toggle P27 LED light
   }

   leftPrev = left;                          // Save previous values
   rightPrev = right;
 }
}

 

If It Doesn’t Work…

Here are some potential symptoms and causes:

P26 light stays off while turning the left wheel.

  • The left feedback signal wire may be plugged into the wrong pin on the P14 servo port.
  • The left feedback singal wire may be plugged into the P15 servo port instead.
  • The left servo’s 3-pin cable might be plugged in backwards.
  • The shunt jumper might be missing or incorrectly set on the voltage selectgor pins next to the P12/P13 servo port.

P27 light stays off while turning the right wheel.

  • The right feedback signal wire may be plugged into the wrong pin on the P15 servo port.
  • The right feedback signal wire may be plugged into the P14 servo port instead.
  • The right servo’s 3-pin cable might be plugged in backwards.
  • The shunt jumper might be missing or incorrectly set on the voltage selector pins next to the P12/P13 servo port.

P27 light instead of P26 light blinks while turning the left wheel (or vice versa).

  • The encoder cables are swapped! Switch the encoder cables plugged into P14 and P15.

If Both Encoders Work

Congratulations! It is time to calibrate your ActivityBot 360°.

 


Printer-friendly version
Navigation Basics
Prev
Calibrate the ActivityBot 360°
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

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

© 2025 Parallax Learn • Built with GeneratePress