Get firmware version (any input mode) – Pololu Simple User Manual

Page 69

Advertising
background image

be decreased below their hard-limit counterparts. If you try to set a temporary limit in a way prohibited by the
corresponding hard limit, the temporary limit value is set to the hard limit and the response code byte indicates that
the value could not be set as requested.

If the arguments to this command are valid, the controller responds to this command with a single-byte code:

Response

Code

Description

0

No problems setting the limit.

1

Unable to set forward limit to the specified value because of Hard Motor Limit settings.

2

Unable to set reverse limit to the specified value because of Hard Motor Limit settings.

3

Unable to set forward and reverse limits to the specified value because of Hard Motor Limit
settings.

Limit IDs above 11 and limit values outside of their allowed value ranges result in a Serial Format Error and no
response is transmitted by the controller.

The limit values set with this command persist only until the controller is next reset or the “Apply
settings” button is next clicked in the Simple Motor Control Center, at which point the temporary
limit settings are all reinitialized to the hard limit settings.

Example:

To set the reverse deceleration limit (limit ID 10) to 500, we can use the above equations to compute that limit
byte 1
must be the remainder of 500/128, or 116, and limit byte 2 must be the quotient of 500/128, or 3. Therefore,
we can send the following compact protocol bytes and wait until we have received one byte in response from the
Simple Motor Controller (or until our receiving function times out, which could happen if there is a problem):

We Send:

Command Byte Data Byte 1 Data Byte 2 Data Byte 3

Compact Protocol

0xA2 (162)

0x0A (10)

0x74 (116)

0x03 (3)

We Receive:

Response Byte 1

0x00 (0)

This response tells us the temporary limit was set as requested. If our Max Deceleration Reverse hard motor limit
was below 500, we would receive a response code of 2, which would tell us that the temporary limit was not set as
requested (rather, it was set equal to whatever the hard limit is).

Get Firmware Version (any input mode)

Command Format:

Pololu Simple Motor Controller User's Guide

© 2001–2014 Pololu Corporation

6. Using the Serial Interface

Page 69 of 101

Advertising