APPRO

To move the robot to the position specified with an offset along the grippers Z (up and down) axis to the distance given.  

Syntax

appro(Location location, double distance);
	
location is a variable of type Location that is instantiated to a reachable point for the gripper.
distance is a double value that still allows the robot to reach the point.

Example	

appro(pick, 2);
	
This will move the gripper to a point 2 inches above a point named pick.
~~~
APPROS

Same as APPRO but arm is moved along a straight line path.

Syntax

appros(Location location, double distance);

location is a variable of type Location that is instantiated to a reachable point for the gripper.
distance is a double value that still allows the robot to reach the point.

Example

appros(pick, 2);

This will move the gripper to a point 2 inches above a point named pick along a straight line path.
~~~
CLOSE

Changes the gripper opening to the specified size before the next move. If the given size is bigger then what the gripper is currently at then the command will be equivalent to an open command.

Syntax

close(double opening);

opening is a double value of the requested opening size.

Example

close(1.5);

This will close the gripper to obtain a 1.5 inches opening. If the opening is currently smaller then 1.5 inches then the gripper will be opened to the requested size. Passing no argument will close the gripper completely.
~~~
CLOSEI

Same as CLOSE but closes the gripper to the requested opening immediately.

Syntax		

closei(double opening);

opening is a double value of the requested opening size.

Example

closei(1.5);

This will close the gripper to obtain a 1.5 inches opening. If the opening is currently smaller then 1.5 inches then the gripper will be opened to the requested size. Passing no argument will close the gripper completely.
~~~
DELAY

Causes the program to stop executing for a specified number of seconds

Syntax

delay(double time);

time is a double value of the requested delay.

Example

delay(5);

This will cause program execution to stop for 5 seconds. The default value of delay is 2 seconds and is achieved by passing no parameter.
~~~
DEPART

Moves the gripper the given distance along the gripper Z axis (up and down).

Syntax

depart(double distance);

distance is a double value of the requested departure.

Example

depart(2);

This will move the gripper a distance of 2 inches upwards from the current location. If a negative value is passed then the gripper will move downwards. 

NOTE: use caution when moving the gripper downwards taking care not to move the gripper below the table.
~~~
DEPARTS

Moves the gripper the given distance along the gripper Z axis (up and down) along a straight line path.

Syntax

departs(double distance);

distance is a double value of the requested departure.

Example

departs(2);

This will move the gripper a distance of 2 inches upwards from the current location using a straight line path. If a negative value is passed then the gripper will move downwards. 

NOTE: use caution when moving the gripper downwards taking care not to move the gripper below the table.
~~~
DRAW

To move the gripper an incremental amount.

Syntax

draw(double distanceX, double distanceY, double distanceZ);

distanceX is a double value of the requested distance in the X axis.
distanceY is a double value of the requested distance in the Y axis.
distanceZ is a double value of the requested distance in the Z axis.

Example	

draw(2, -3 4);

This will move the gripper a distance of 2 inches along the positive X axis, 3 inches along the negative Y axis and 4 inches along the positive Z axis. Any of the values can be 0 if you do not wish to change that particular location.

NOTE: use caution when moving the gripper downwards taking care not to move the gripper below the table.
~~~
GRASP

To close the gripper on an object and return the size of the object in the gripper.

Syntax

grasp();

Example

grasp();

This will close the gripper on an object if one exists. It will then return the size of the object in between the gripper.
~~~
HERE

To set the value of a Location variable to the current location of the robot.

Syntax

here(String name);

name is the string name that you wish to give to this new location

Example

Location center = here(center);

This will create a new Location object with the name of center and its coordinates will the current coordinated of the robot.
~~~
MOVE

To move the robot to the position and orientation specified.

Syntax

move(Location loc);

loc is the name of a previously defined Location object.

Example

move(center);

This will move the robot to the location described by the Location object named center.

NOTE: Location objects can be created using software by clicking on Add New Point or by manually coding them.
~~~
MOVES

To move the robot to the position and orientation specified. Very similar to MOVE but this command moves the robot along a straight line path.

Syntax

moves(Location loc);

loc is the name of a previously defined Location object.

Example

moves(center);

This will move the robot to the location described by the Location object named center along a straight line path from the current location.

NOTE: Location objects can be created using software by clicking on Add New Point or by manually coding them.
~~~
MOVET

To move the robot to the position and orientation specified, by first setting the gripper opening to the requested size.

Syntax

movet(Location loc, double opening);

loc is the name of a previously defined Location object.
opening is a double value of the requested gripper opening.

Example

movet(center, 1.5);

This will move the robot to the location described by the object named center but first the gripper opening will be set to 1.5 inches.

NOTE 1: Location objects can be created using software by clicking on Add New Point or by manually coding them.

NOTE 2: Setting the gripper opening may involve opening or closing the gripper. This will depend on the previous opening before this command is issued.
~~~
MOVEST

To move the robot to the position and orientation specified along a straight line path, by first setting the gripper to the requested size.

Syntax

movest(Location loc, double opening);

loc is the name of a previously defined Location object.
opening is a double value of the requested gripper opening.

Example

movest(center, 1.5);

This will move the robot to the location described by the object named center along a straight line path but first the gripper opening will be set to 1.5 inches. 

NOTE 1: Location objects can be created using software by clicking on Add New Point or by manually coding them.

NOTE 2: Setting the gripper opening may involve opening or closing the gripper. This will depend on the previous opening before this command is issued.
~~~
OPEN

To change the gripper opening immediately prior to the next move statement to the desired size.

Syntax

open(double opening);

opening is a double value of the requested gripper opening.

Example

open(2.25);

This will set the gripper opening to a width of 2.25 inches. If the current opening is smaller then 2.25 inches then the opening will get wider, if it is wider the gripper will close to the desired size.

NOTE: If no parameter is passed the default opening is 2 inches.
~~~
OPENI

To change the gripper opening immediately to the desired size.

Syntax

openi(double opening);

opening is a double value of the requested gripper opening.

Example

openi(2.25);

This will set the gripper opening to a width of 2.25 inches. If the current opening is smaller then 2.25 inches then the opening will get wider, if it is wider the gripper will close to the desired size.

NOTE: If no parameter is passed the default opening is 2 inches.
~~~
READY

To move the robot arm to the initial (home) position.

Syntax

ready();

Example

ready();

This will move the robot arm to the initial position that is generally called the HOME position.

NOTE: Take caution that the robot arm does not strike anything when moving to the READY position.
~~~
SHIFT

To modify the X, Y and Z coordinated of a Location variable.

Syntax

shift(Location loc, double x, double y, double z);			

loc is the Location object that you wish to shift.
x,y,z are double values corresponding to the desired shift of each of the coordinates.

Example

shift(center, 2, 0, -1);

This will shift the coordinates of the location named center 2 inches in the positive X direction, 0 inches in the Y direction and 1 inch in the negative Z direction.

NOTE 1: If you do not want to shift a particular coordinate just leave a 0 in the proper place.

NOTE 2: Be careful when shifting the Z coordinate not to allow the gripper to move below the table.
~~~
SIGNAL

To turn the robot output ports ON or OFF.

Syntax

signal(integer whatPort[]);

whatPort can be a single integer or an array of integers between -5 and 5

Example

signal(-3);

This sets the 3rd output port to go low (become 0). If the output port is already low then there will be no change.
~~~
SPEED

Changes the speed of execution of the proceeding robot commands by the given speed. This speed is maintained until the program finishes executing or until another SPEED command changes the speed.

Syntax

speed(int speed);			

speed is an integer value between 0 and 240 corresponding to the desired speed.

Example

speed(Microbot.MEDIUM);

This will set the speed of execution to the MEDIUM speed set in the class Microbot. This speed corresponds to a value of 190.

NOTE: If the given speed is greater then 240 the default of 240 will be set. Also if the given speed is less then 0 then 0 will be set as the speed.
~~~
TYPE

To display a message on the screen.

Syntax

type(String text);		

text is a String that you wish to appear on the screen.	

Example

type(Start of program);

This will print Start of program (without the quotes) to the system output window.
~~~
WAIT

To suspend program execution until a desired input status is achieved.

Syntax

wait(integer whatPort[]);

whatPort can be a single integer or an array of integers between -7 and 7		

Example

int array[] = {-3, 2, 7}; wait(array);

This will suspend program execution until input port 3 becomes low and inputs 2 and 7 become high.
~~~