RT1 represents the Run mode and RT2 jumps to the Test mode.
Before we move further into the program description, we need to look
at the data packet the CMU-01 delivers when we issue a Track Color (TC)
M Packet in Raw Mode
The following is a byte description of the M packet serial data we receive
from the CMU-01. By placing the serial data in an array, we can have the PIC
read the data in the serial array and perform functions depending upon its
value. Interpreting the M-Packet data is key to the program.
The first three bytes equal ACK
The fourth byte equals a Return
M packet ID
Middle Mass x value
Middle Mass y value
Leftmost X corner
Leftmost Y corner
Rightmost X corner
Rightmost Y corner
Number of pixels in tracked
Colon (Punctuation Mark)
Both the Test and Run modes read the M packet. Based upon the values
read in the M packet, the robot either moves to track (Run) or reports the
information (Test) on the LCD.
Do You See What I See?
The CMU camera’s view of a target may be different than what you
would expect. The Test mode has been designed to help you select good
target objects and to test their functionality with the C-Bot. In Test mode,
the servomotors are not active. The LCD display provides text information on
what the CMU camera sees and how the robot would move if its servomotors
Testing a Target
Place the Mode switch to “TEST” on the main circuit board. Choose a
primary color target (like a red ball). Turn on the LCD, CMU-01 camera, and
main circuit board power.
The LCD should display “C-Bot Tracker” upon start-up. Check the LCD
panel; you may need to adjust the contrast to see the text information
The next LCD display will say “Blink LED” (Figure 14). The green LED
should blink several times with a time period of 200 milliseconds. This
establishes that the communication link between the PIC and CMU-01 is
The next display states “Color & AE on” on LCD line 1 and “Wait 5 sec.”
on LCD line 2 (Figure 15). The CMU-01 camera should be facing a blank wall
to help it adjust for the ambient light.
The next display states “Place Target” on LCD line 1 and “ 5 sec.” on LCD
line 2 (Figure 16). In addition, the green LED will blink 10 times with a period
52 SERVO 05.2009