#include <motor/SabertoothDriver.h>
|
static void | autobaud (Stream &port, boolean dontWait=false) |
|
◆ SabertoothDriver()
SabertoothDriver::SabertoothDriver |
( |
byte |
address, |
|
|
Stream & |
port |
|
) |
| |
|
inline |
Initializes a new instance of the Sabertooth class. The driver address is set to the value given, and the specified serial port is used.
- Parameters
-
address | The driver address. |
port | The port to use. |
◆ address()
byte SabertoothDriver::address |
( |
| ) |
const |
|
inline |
Gets the driver address.
- Returns
- The driver address.
◆ autobaud() [1/2]
void SabertoothDriver::autobaud |
( |
boolean |
dontWait = false | ) |
const |
|
inline |
Sends the autobaud character.
- Parameters
-
dontWait | If false, a delay is added to give the driver time to start up. |
◆ autobaud() [2/2]
static void SabertoothDriver::autobaud |
( |
Stream & |
port, |
|
|
boolean |
dontWait = false |
|
) |
| |
|
inlinestatic |
Sends the autobaud character.
- Parameters
-
port | The port to use. |
dontWait | If false, a delay is added to give the driver time to start up. |
◆ command()
void SabertoothDriver::command |
( |
byte |
command, |
|
|
byte |
value |
|
) |
| const |
|
inline |
Sends a packet serial command to the motor driver.
- Parameters
-
command | The number of the command. |
value | The command's value. |
◆ drive()
void SabertoothDriver::drive |
( |
int |
power | ) |
const |
|
inline |
Sets the driving power.
- Parameters
-
power | The power, between -127 and 127. |
◆ motor() [1/2]
void SabertoothDriver::motor |
( |
byte |
motor, |
|
|
int |
power |
|
) |
| const |
|
inline |
Sets the power of the specified motor.
- Parameters
-
motor | The motor number, 1 or 2. |
power | The power, between -127 and 127. |
◆ motor() [2/2]
void SabertoothDriver::motor |
( |
int |
power | ) |
const |
|
inline |
Sets the power of motor 1.
- Parameters
-
power | The power, between -127 and 127. |
◆ setAddress()
void SabertoothDriver::setAddress |
( |
byte |
addr | ) |
|
|
inline |
Sets the driver address.
- Returns
- The driver address.
◆ setBaudRate()
void SabertoothDriver::setBaudRate |
( |
long |
baudRate | ) |
const |
|
inline |
Sets the baud rate. Baud rate is stored in EEPROM, so changes persist between power cycles.
- Parameters
-
baudRate | The baud rate. This can be 2400, 9600, 19200, 38400, or on some drivers 115200. |
◆ setDeadband()
void SabertoothDriver::setDeadband |
( |
byte |
value | ) |
const |
|
inline |
Sets the deadband. Deadband is stored in EEPROM, so changes persist between power cycles.
- Parameters
-
value | The deadband value. Motor powers in the range [-deadband, deadband] will be considered in the deadband, and will not prevent the driver from entering nor cause the driver to leave an idle brake state. 0 resets to the default, which is 3. |
◆ setMaxVoltage()
void SabertoothDriver::setMaxVoltage |
( |
byte |
value | ) |
const |
|
inline |
Sets the maximum voltage. Maximum voltage is stored in EEPROM, so changes persist between power cycles.
- Parameters
-
value | The voltage. The units of this value are driver-specific and are specified in the Packet Serial chapter of the driver's user manual. |
◆ setMinVoltage()
void SabertoothDriver::setMinVoltage |
( |
byte |
value | ) |
const |
|
inline |
Sets the minimum voltage.
- Parameters
-
value | The voltage. The units of this value are driver-specific and are specified in the Packet Serial chapter of the driver's user manual. |
◆ setRamping()
void SabertoothDriver::setRamping |
( |
byte |
value | ) |
const |
|
inline |
Sets the ramping. Ramping is stored in EEPROM, so changes persist between power cycles.
- Parameters
-
value | The ramping value. Consult the user manual for possible values. |
◆ setTimeout()
void SabertoothDriver::setTimeout |
( |
int |
milliseconds | ) |
const |
|
inline |
Sets the serial timeout.
- Parameters
-
milliseconds | The maximum time in milliseconds between packets. If this time is exceeded, the driver will stop the motors. This value is rounded up to the nearest 100 milliseconds. This library assumes the command value is in units of 100 milliseconds. This is true for most drivers, but not all. Check the packet serial chapter of the driver's user manual to make sure. |
◆ stop()
void SabertoothDriver::stop |
( |
| ) |
const |
|
inline |
◆ turn()
void SabertoothDriver::turn |
( |
int |
power | ) |
const |
|
inline |
Sets the turning power.
- Parameters
-
power | The power, between -127 and 127. |
The documentation for this class was generated from the following file: