Control DC motors that have incremental encoders. Each motor is specified by a different index: 1, 2, 3, ...
The units used in this library are:
Warning: this library must be configured by a board-specific library in order to control that board.
The board-specific library must define the following blocks (which take no arguments):
edcmotors_getNumMotors
: return the number of DC motors you are using._edcmotors_initSystemVariables
: initialize system-specific Encoded DC Motors
variables._edcmotors_checkSystem
: check that the motors are powered on, or similar. This block is optional, but highly recommended if there is anything the user must do to run the motors. For example the XRP has a power switch that must be on to run the motors, but not to program the board via USB. That makes it very easy to forget to turn on the power switch.See the XRP library for an example.
For each block, there is a short description entry and a detailed block and component description. You can click on block pictures in the short description table to access the details.
e
Move the specified motor at the specified speed (encoder counts/second).
Note that this block exits almost immediately; if you want to wait for the motors to be stopped, put after this block.
Move the specified motor the specified distance (encoder counts) at the specified speed (encoder counts/second). The speed must not be zero (since the move would never end).
Note that this block exits almost immediately; if you want to wait for the move to finish (or stopped early), put after this block.
Move the specified motor with the specified effort (-1023 to 1023). This ignores the encoders.
Reset one or more motor encoder values to 0. Please only do this when not controlling the motor in a feedback loop, because otherwise the motor may start moving very abruptly.
This is a low-level block that is unlikely to be in normal code.
Stop all motors.
Stop one or more motors.
Wait for one or more motors to stop.