Concept: motor[ sLabel ]

Printer-friendly version

RobotC Element Type: Variable

Usage: Array that holds power levels for the motor addressed.

Syntax Example: motor[ [string] label ]

  1. #pragma config(Motor,  motorA, , tmotorNormal, PIDControl, encoder)
  2. //*!!Code automatically generated by 'ROBOTC' configuration wizard!!*//
  4. task main
  5. {
  6.   motor[motorA] = 100;
  7.   wait1Msec(1000);
  8. }

Note: When you set the power of a motor, it will remain at that power level until the value is changed. You will need to use other timing commands to determine how long the motor will run at that power level.