
Command encoding:
0xAC lower 7 bits of flags upper 3 bits of flags
Description:
For each bit in the
flags
argument that is 1, this command sets the corresponding bit in the “Status
flags” variable to 1. The “Status flags” variable and all of its bits are documented in
Set speed
Arguments
Mode:
normal, now, or buffered
Motor:
a motor number
Speed
: from −800 to 800
Response
None
Arduino library
void setSpeed(uint8_t motor, int16_t speed)
void setSpeedNow(uint8_t motor, int16_t speed)
void setBufferedSpeed(uint8_t motor, int16_t speed)
Command encoding:
0xD1 for normal mode
0xD2 for now mode
0xD4 for buffered mode
motor lower 7 bits of speed upper 7 bits of speed
Description:
The
motor
argument should be between 1 and the number of motors that your Motoron supports.
If it is invalid, the Motoron reports a protocol error.
The
speed
argument should be a speed between −800 and 800. If the specified speed is outside
this range, the Motoron will change it to the closest valid speed between −800 and 800. See
the documentation of the “Current speed” variable in
for more details about what the
different speed values mean. The speed argument is encoded as a 14-bit
[https://en.wikipedia.org/wiki/Two%27s_complement]
number.
The
mode
specifies when and how to apply the speed:
•
Normal mode:
The motor’s “Target speed” is changed. The “Current speed” will start
moving towards the target speed, obeying acceleration and deceleration limits. The
Pololu Motoron Motor Controller User’s Guide
© 2001–2022 Pololu Corporation
9. Command reference
Page 61 of 67