beautypg.com

Motor m0 commands, Command 0x88 (136): motor m0 forward, Command 0x8a (138): motor m0 reverse – Pololu Qik 2s12v10 User Manual

Page 26: Motor m1 commands

background image

as the speed parameter ranges from 0 to 127. In 8-bit mode, motor speed ranges from stopped (high-impedance
outputs, or “coast”) to full speed as the speed parameter ranges from 0 – 255.

The eight set-motor commands are enumerated below, but some users might prefer to think of the set-motor
command byte in terms of the meanings of various bits in the byte (bit 0 is the least-significant bit):

bit 7 (sync bit): Set this bit when using the Compact Protocol; clear this bit when using the Pololu
Protocol.

bits 6:3 (set motor command bits): for this command, set bit 3 and clear bits 4 – 6.

bit 2 (motor bit): Set this bit for motor M1; clear this bit for motor M0.

bit 1 (direction bit): Set this bit for “reverse”; clear this bit for “forward”.

bit 0 (speed mode bit): This is the eighth motor speed bit when the qik is in 8-bit PWM mode (i.e. set this
bit to add 128 to the speed data byte). This bit has no effect when the qik is in 7-bit PWM mode.

Motor M0 Commands

Commands 0x88 – 0x8B apply to motor M0. In 8-bit mode, commands 0x89 and 0x8B set the motor speed to
128+motor speed; in 7-bit mode, command 0x89 is identical to command 0x88 and command 0x8B is identical
to command 0x8A.

For example, in 8-bit mode, the command packet 0x88, 0x7F sets motor M0 speed to 127 out of a maximum
of 255, which turns the motor at half speed. The command packet 0x89, 0x7F sets motor M0 speed to 127+128
= 255, which turns the motor at full speed. In 7-bit mode, both commands set motor M0 speed to 127 out of a
maximum of 127, which turns the motor at full speed.

Command 0x88 (136):

Motor M0 Forward

Compact protocol: 0x88, motor speed
Pololu protocol: 0xAA, device ID, 0x08, motor speed

Command 0x89 (137):

Motor M0 Forward (speed + 128; used in 8-bit mode)

Compact protocol: 0x89, motor speed
Pololu protocol: 0xAA, device ID, 0x09, motor speed

Command 0x8A (138):

Motor M0 Reverse

Compact protocol: 0x8A, motor speed
Pololu protocol: 0xAA, device ID, 0x0A, motor speed

Command 0x8B (139):

Motor M0 Reverse (speed + 128; used in 8-bit mode)

Compact protocol: 0x8B, motor speed
Pololu protocol: 0xAA, device ID, 0x0B, motor speed

Motor M1 Commands

Commands 0x8C – 0x8F apply to motor M1. In 8-bit mode, commands 0x8D and 0x8F set the motor speed to
128+motor speed; in 7-bit mode, command 0x8D is identical to command 0x8C and command 0x8F is identical
to command 0x8E.

For example, in 8-bit mode, the command packet 0x8C, 0x7F sets motor M1 speed to 127 out of a maximum
of 255, which turns the motor at half speed. The command packet 0x8D, 0x7F sets motor M1 speed to 127+128

Qik 2s12v10 User's Guide

© 2001–2012 Pololu Corporation

5. Serial Parameters and Commands

Page 26 of 33