Motor Statement

Sets a particular motor's speed to the specified percentage. Only 1 motor can be specified at a time. The Handyboard supports motor numbers 1 to 4. The speed percentage can range from -100 to 100. Any speed outside of that range will be rounded to the closest valid speed.

Syntax

  1. motor('Motor Number', speed);

Example

  1. //Use Motors 2 & 4 to turn sharply for 3 seconds.
  2. void main()
  3. {
    1. motor(2,95);
    2. motor(4,-95);
    3. sleep(3.0);
    4. ao();
  4. }