TETRIX Functions Servos
From ROBOTC API Guide
TETRIX → Functions and Variables → Servos
| For more examples and explanations, head over to Motors and Servos Overview, Using Motor and Servo Controllers, and Servo Controller
There are three motors on the NXT labeled A, B and C. Each motor is equipped with an integrated encoder that can be used to determine the current position of the motor. The encoders have 360 counts per single revolution of the motor. A count of 180 indicates that the motor has traveled half a rotation. |
|
| |||||||
servo
| short servo[TServoIndex servo] | ||||||
| (short) This function is used to set the position of the servos on a sensor port Servo controller. Values can range from 0 to 255. The firmware will automatically move the servo to this poisition over the next few update intervals. (Be sure to give the servo some amount of time to reach the new position before going on in your code.)
NOTE: This function is equivalent to the deprecated function, servoTarget[TServoIndex servo]. | ||||||
| ||||||
|
servoChangeRate
| short servoChangeRate[TServoIndex servo] | ||||||
| (short) Specifies the rate at which an individual servo value is changed. A value of zero inidcates servo will move at maximum speed. The change rate is a useful variable for "smoothing" the movement of the servos and preventing jerky motion from software calculated rapid and wide changes in the servo value. The default value is a change rate of 10 positions on every servo update which occurs. (updates occur every 20 milliseconds) | ||||||
| ||||||
|
ServoValue
| short ServoValue[TServoIndex servo] | ||||||
| (short) This read-only function is used to read the current position of the servos on a sensor port Servo controller. Values can range from 0 to 255. The value returned in this variable is the last position that the firmware has told the servo to move to. This may not be the actual position because the servo may not have finished the movement or the mechanical design may block the servo from fully reaching this position. To set the position of a servo, use the "servoTarget" or "servo" functions. | ||||||
| ||||||
|