Sabertooth Simplified Serial Library for Arduino
Control your Sabertooth with Simplified Serial.
|
SabertoothSimplified Class Reference
Controls a Sabertooth motor driver running in Simplified Serial mode. More...
Public Member Functions | |
SabertoothSimplified () | |
SabertoothSimplified (Print &port) | |
void | motor (int power) |
void | motor (byte motor, int power) |
void | drive (int power) |
void | turn (int power) |
void | stop () |
Detailed Description
Controls a Sabertooth motor driver running in Simplified Serial mode.
Constructor & Destructor Documentation
SabertoothSimplified::SabertoothSimplified | ( | ) |
Initializes a new instance of the SabertoothSimplified class. The Arduino TX serial port is used.
SabertoothSimplified::SabertoothSimplified | ( | Print & | port | ) |
Initializes a new instance of the SabertoothSimplified class. The specified serial port is used.
- Parameters
-
port The port to use.
Member Function Documentation
void SabertoothSimplified::drive | ( | int | power | ) |
Sets the driving power.
- Parameters
-
power The power, between -127 and 127.
- Examples:
- TankStyleSweep.ino.
void SabertoothSimplified::motor | ( | int | power | ) |
Sets the power of motor 1.
- Parameters
-
power The power, between -127 and 127.
- Examples:
- SimpleExample/SimpleExample.ino, and Sweep/Sweep.ino.
void SabertoothSimplified::motor | ( | byte | motor, |
int | power | ||
) |
Sets the power of the specified motor.
- Parameters
-
motor The motor number, 1 or 2. power The power, between -127 and 127.
void SabertoothSimplified::stop | ( | ) |
Stops.
void SabertoothSimplified::turn | ( | int | power | ) |
Sets the turning power.
- Parameters
-
power The power, between -127 and 127.
- Examples:
- TankStyleSweep.ino.