Professional Documents
Culture Documents
Intro to Robotics
Motors and Sensors Setup
The first thing we need to do is
tell ROBOTC that we have
motors on our robot.
You will notice that at the top there are PRAGMA statements. These are
automatically generated configuration statements and will ALWAYS be at
the very top of the program.
Let’s compile
If it asks you to save, call it
motion lesson 1.
WHAT HAPPENED?
Compile Errors
Errors have different
colors and are displayed
next to the code line
number where there is a
problem. Here we see a
problem in line 9.
Errors are explained in a little bit more detail below. If you have no errors, then the
program compiled correctly.
Compiled Correctly
Attaching to a PC
Use a USB cable to
connect the robot to
the PC. It is often an
ORANGE cable.
Possible errors:
•Cortex power on? If not, RobotC may ask you to turn on the battery.
•Can’t find the COM port? If not, unplug the USB cable with the cortex
powered on, then re-insert and try again.
What happened????
Motors and Sensors Setup
Motors and Sensors Setup