next up previous contents
Next: void fd(int m) Up: 9.1 Output Control Previous: 9.1 Output Control

9.1.1 DC Motors

DC motor ports are numbered from 0 to 3.

Motors may be set in a ``forward'' direction (corresponding to the green motor LED being lit) and a ``backward'' direction (corresponding to the motor red LED being lit).

The functions fd(int m) and bk(int m) turn motor m on or off, respectively, at full power. The function off(int m) turns motor m off.

The power level of motors may also be controlled. This is done in software by a motor on and off rapidly (a technique called pulse-width modulation. The motor(int m, int p) function allows control of a motor's power level. Powers range from

100 (full on in the forward direction) to -100 (full on the the backward direction). The system software actually only controls motors to seven degrees of power, but argument bounds of -100 and +100 are used.





Fred G. Martin
Fri Mar 29 17:44:15 EST 1996