Motor reverse (serial/usb input mode only), Motor forward 7-bit (serial/usb input mode only) – Pololu Simple User Manual

Page 64

Advertising
background image

This command has no serial response.

Example:

If we want to set the motor target speed to half-speed forward, we can use the above equations to compute that the
first speed byte must be the remainder of 1600/32, or 0, and the second speed byte must be the quotient of 1600/
32, or 50. Therefore, we can send the following compact protocol bytes:

We Send:

Command Byte Data Byte 1 Data Byte 2

Compact Protocol

0x85 (133)

0x00 (0)

0x32 (50)

Alternate Interpretation: The allowed values for the second speed data byte are 0–100, so you can ignore the
first speed data byte (always set it to 0), and consider the second data byte to simply be the speed percentage. For
example, to drive the motor at 53% speed, you would use byte1=0 and byte2=53.

Motor Reverse (Serial/USB input mode only)

Command Format:

Command Byte

Data Byte 1

Data Byte 2 Data Byte 3 Data Byte 4

Compact Protocol

0x86 (134)

speed byte 1

speed byte 2

-

-

Compact Alternate Use

0x86 (134)

0

speed %

-

-

Pololu Protocol

0xAA (170)

device number

0x06 (6)

speed byte 1 speed byte 2

Pololu Alternate Use

0xAA (170)

device number

0x06 (6)

0

speed %

Description: This command lets you set the full-resolution motor target speed in the reverse direction. The
motor speed must be a number from 0 (motor stopped) to 3200 (motor reverse at full speed) and is specified
using two data bytes, the first containing the low five bits of the speed and the second containing the high seven
bits of the speed. This command behaves the same as the Motor Forward command except the motor moves in
the opposite direction.

Motor Forward 7-Bit (Serial/USB input mode only)

Command Format:

Command Byte

Data Byte 1

Data Byte 2 Data Byte 3

Compact Protocol

0x89 (137)

speed

-

-

Pololu Protocol

0xAA (170)

device number

0x09 (9)

speed

Description: This command sets the motor target speed in the forward direction based on the specified low-
resolution (7-bit) Speed byte. The Speed byte is a number from 0 (motor stopped) to 127 (motor forward at full
speed). This command has no serial response.

Example:

Pololu Simple Motor Controller User's Guide

© 2001–2014 Pololu Corporation

6. Using the Serial Interface

Page 64 of 101

Advertising