Calvin's H-bridge Motor Library
Get the H-bridge library here.
motor
|
Declares a new motor.
Members:
example: motor leftm; leftm.pin1 = 2; leftm.pin1 = 3; leftm.pwm = 10; |
moveMotor
|
Moves the specified motor at a certain power level. Uses the motor type.
moveMotor(motor motorname, int power_level); where motorname is the name of the motor you want to move, and power_level is from -255 to 255, negative values automatically treated as reverse direction. example: moveMotor(leftm, -127); |
stopMotor
|
Stops the specified motor. Defaults to brake if not specified.
stopMotor(motor motorname, bool brake); where motorname is the name of the motor you want to move, and brake is whether you want the motor to brake or coast. example: stopMotor(leftm, 0); |