basic functions

move(mm); //moves the robot a specific number of millimeters - is backwards (blocking)

turn(degrees); //turns robot the specified number of degrees (blocking)

turnto(degrees); //turns robot to a specific heading relative to its starting position (blocking)

speed(mm/s); // how fast the robot should move in mm per second (non blocking)

rotate(degrees/s); //spin robot at specified degrees per second

halt; //stops the robot

blocking means that the program will wait till the command has finish until going onto the next comand so for example if you tell it to turn 90 degrees and then tell it to move 100mm it will wait until it finishes turning 90 degrees before it moves 100 mm. Non blocking doesn't wait. You can specify not to block or to wait a certain amount of time so if you want it to start turning 90 degrees and move forward 1000 mm you would say

turn(90) noblock; move(1000);

all lines that are complete must end with a semi-colon ";"

move(100); //move 100mm forward

comments are designated by // or surrounded by /* */

halt; //this tells the robot to stop

/*this is the part of the code that will get the robot to turn 90 degrees*/ turn(90);


Page last modified September 26, 2005, at 10:18 AM