Module:Motor
Description: stepper motor driver
Source: motor.asm
Wrapper: motor.c
  motor.h

Description:

The Motor module handles driving a stepper motor. It can make the motor turn to the left. Or to the right. The motor cannot currently turn in both directions at the same time.

Commands:

cokerr Motor_QueryVersion (char* versionstring)
returns the version string.

cokerr Motor_SetStep (byte stepnum)
sets the stepper motor pattern directly. stepnum should be between 0 and 7.
Errors: ERROR_Motor_BadStepNumber

cokerr Motor_SetSpeed (word speed)
sets the motor turning speed, effective with the next Turn command. The motor will turn one step every (speed * 8) milliseconds.

cokerr Motor_StepLeft ()
steps the motor one step to the left.

cokerr Motor_StepRight ()
steps the motor one step to the right.

cokerr Motor_TurnLeft (word numsteps)
starts the motor turning to the left. If numsteps is zero, the motor will turn until stopped; otherwise, it will turn numsteps steps or until stopped.

cokerr Motor_TurnRight (word numsteps)
starts the motor turning to the right. If numsteps is zero, the motor will turn until stopped; otherwise, it will turn numsteps steps or until stopped.

cokerr Motor_Stop ()
stops the motor, if it is turning.

cokerr Motor_Release ()
turns off current to the motor. After a Step or Turn command, the motor (even if stopped) is pulling current to hold its position. After being released, the motor draws no current and can turn freely.