| Wait Functions: | ||||||
| Title | Picture | Description | Default Usage and Sample | Usage and Sample with Parameters | ||
| Wait | ![]() |
Wait an amount of time measured in seconds. | wait(time)
|
wait(time)
|
||
| Wait in Milliseconds | ![]() |
Wait an amount of time measured in milliseconds. | waitInMilliseconds(time)
|
waitInMilliseconds(time)
|
||
| Movement Functions: | ||||||
| Title | Picture | Description | Default Usage and Sample | Usage and Sample with Parameters | ||
| Forward | ![]() |
Both wheels rotate forward at the same speed and the robot moves straight forward. Range: -100 to 100 (Forward will always move your robot forward.) |
forward(speed)
|
forward(speed)
|
||
| Backward | ![]() |
Both wheels rotate backward at the same speed and the robot moves straight backward. Range: -100 to 100 (Backward will always move your robot backward.) |
backward(speed)
|
backward(speed)
|
||
| Point Turn | ![]() |
Both wheels rotate at the same speed but in opposite directions, causing the robot to turn around it's center. This makes a sharp turn in place. Range: -100 to 100 |
pointTurn(direction, speed)
|
pointTurn(direction, speed)
|
||
| Swing Turn | ![]() |
One wheel rotates while the other does not move, causing the robot to turn around the stopped wheel. This makes a wide turn. Range: -100 to 100 |
swingTurn(direction, speed)
|
swingTurn(direction, speed)
|
||
| Stop | ![]() |
Both wheels do not move, causing the robot to stop. | stop()
|
stop()
|
||
| Set Motor | ![]() |
Set a motor to a speed. Range: -100 to 100 Acceptable Motors: motorA, motorB, motorC (and your names for them given in Motors and Sensors Setup.) |
setMotor(motor, speed)
|
setMotor(motor, speed)
|
||
| Stop Motor |
![]() |
Stops a motor. Acceptable Motors: motorA, motorB, motorC (and your names for them given in Motors and Sensors Setup.) |
stopMotor(motor)
|
stopMotor(motor)
|
||
| Until Functions: | ||||||
| Title | Picture | Description | Default Usage and Sample | Usage and Sample with Parameters | ||
| Until Touch | ![]() |
The robot does what it was doing until the touch sensor is pressed in. Acceptable Sensors: S1, S2, S3, S4 (and your names for them given in Motors and Sensors Setup.) |
untilTouch(sensor)
|
untilTouch(sensor)
|
||
| Until Release | ![]() |
The robot does what it was doing until the touch sensor is released. Acceptable Sensors: S1, S2, S3, S4 (and your names for them given in Motors and Sensors Setup.) |
untilRelease(sensor)
|
untilRelease(sensor)
|
||
| Until Bump | ![]() |
The robot does what it was doing until the touch sensor is pressed in and then released out. Acceptable Sensors: S1, S2, S3, S4 (and your names for them given in Motors and Sensors Setup.) |
untilBump(sensor)
|
untilBump(sensor)
|
||
| Until Sonar - Greater Than
|
![]() |
The robot does what it was doing until the sonar sensor reads a value greater than a set distance in centimeters. Range: 0 to 255 Acceptable Sensors: S1, S2, S3, S4 (and your names for them given in Motors and Sensors Setup.) |
untilSonarGreaterThan(distance, sensor)
|
untilSonarGreaterThan(distance, sensor)
|
||
| Until Sonar - Less Than |
![]() |
The robot does what it was doing until the sonar sensor reads a value less than a set distance in centimeters. Range: 0 to 255 Acceptable Sensors: S1, S2, S3, S4 (and your names for them given in Motors and Sensors Setup.) |
untilSonarLessThan(distance, sensor)
|
untilSonarLessThan(distance, sensor)
|
||
| Until Button Press |
![]() |
The robot does what it was doing until a button on the NXT is pressed. Acceptable Buttons: centerBtnNXT, rightBtnNXT, leftBtnNXT |
untilButtonPress(nxtButton)
|
untilButtonPress(nxtButton)
|
||
| Until Light |
![]() |
The robot does what it was doing until the light sensor reads a value lighter than the threshold. Range: (dark) 0 to 100 (light) Acceptable Sensors: S1, S2, S3, S4 (and your names for them given in Motors and Sensors Setup.) |
untilLight(threshold, sensor)
|
untilLight(threshold, sensor)
|
||
| Until Dark |
![]() |
The robot does what it was doing until the light sensor reads a value darker than the threshold. Range: (dark) 0 to 100 (light) Acceptable Sensors: S1, S2, S3, S4 (and your names for them given in Motors and Sensors Setup.) |
untilDark(threshold, sensor)
|
untilDark(threshold, sensor)
|
||
| Until Sound |
![]() |
The robot does what it was doing until the sound sensor reads a sound greater than the threshold. Range: (silent) 0 to 100 (noisy) Acceptable Sensors: S1, S2, S3, S4 (and your names for them given in Motors and Sensors Setup.) |
untilSound(threshold, sensor)
|
untilSound(threshold, sensor)
|
||
| Until Rotations | ![]() |
The robot does what it was doing until the wheel rotations match the desired value. Range: 0 to >65000 Acceptable Motors: motorA, motorB, motorC (and your names for them given in Motors and Sensors Setup.) |
untilRotations(rotations, motor)
|
untilRotations(rotations, motor)
|
||
| Until Encoder Counts | ![]() |
The robot does what it was doing until the encoder counts match the desired value. Range: 0 to >65000 Acceptable Motors: motorA, motorB, motorC (and your names for them given in Motors and Sensors Setup.) |
untilEncoderCounts(counts, motor)
|
untilEncoderCounts(counts, motor)
|
||
| Line Following Functions: | ||||||
| Title | Picture | Description | Default Usage and Sample | Usage and Sample with Parameters | ||
| Line Track - For Time | ![]() |
The robot will track a black line on a white surface for a specified time in seconds. Threshold Range: (dark) 0 to 100 (light) Acceptable Sensors: S1, S2, S3, S4 (and your names for them given in Motors and Sensors Setup.) |
lineTrackForTime(time, threshold, sensor)
|
lineTrackForTime(time, threshold, sensor)
|
||
| Line Track - For Rotations | ![]() |
The robot will track a black line on a white surface for a specified distance in rotations. Threshold Range: (dark) 0 to 100 (light) Acceptable Sensors: S1, S2, S3, S4 (and your names for them given in Motors and Sensors Setup.) |
lineTrackForRotations(rot, threshold, sensor)
|
lineTrackForRotations(rot, threshold, sensor)
|
||
| (print me in landscape mode) | ||||||