|
RSeries astromech firmware
|
|
Go to the documentation of this file.
19 #ifndef SabertoothDriver_h
20 #define SabertoothDriver_h
81 static void autobaud(Stream& port,
boolean dontWait =
false)
102 if (fPort !=
nullptr)
130 throttleCommand((
motor == 2 ? 4 : 0) + (power < 0 ? 1 : 0), power);
140 throttleCommand(power < 0 ? 9 : 8, power);
149 throttleCommand(power < 0 ? 11 : 10, power);
167 command(2, (
byte)min((
int)value, 120));
177 command(3, (
byte)min((
int)value, 127));
187 #if defined(ARDUINO) && ARDUINO >= 100
213 #if defined(ARDUINO) && ARDUINO >= 100
236 command(17, (
byte)min(
int(value), 127));
246 command(16, (
byte)min(
int(value), 80));
259 command(14, (
byte)((constrain(milliseconds, 0, 12700) + 99) / 100));
263 void throttleCommand(
byte command,
int power)
const
265 power = constrain(power, -126, 126);
266 this->
command(command, (
byte)abs(power));
271 Stream* fPort =
nullptr;
static void autobaud(Stream &port, boolean dontWait=false)
Definition: SabertoothDriver.h:81
byte address() const
Definition: SabertoothDriver.h:50
void setMinVoltage(byte value) const
Definition: SabertoothDriver.h:165
void motor(int power) const
Definition: SabertoothDriver.h:116
void setBaudRate(long baudRate) const
Definition: SabertoothDriver.h:185
void command(byte command, byte value) const
Definition: SabertoothDriver.h:100
void setAddress(byte addr)
Definition: SabertoothDriver.h:59
void setDeadband(byte value) const
Definition: SabertoothDriver.h:234
SabertoothDriver(byte address, Stream &port)
Definition: SabertoothDriver.h:40
void motor(byte motor, int power) const
Definition: SabertoothDriver.h:126
void setTimeout(int milliseconds) const
Definition: SabertoothDriver.h:257
void turn(int power) const
Definition: SabertoothDriver.h:147
void stop() const
Definition: SabertoothDriver.h:155
void setRamping(byte value) const
Definition: SabertoothDriver.h:244
Definition: SabertoothDriver.h:31
void autobaud(boolean dontWait=false) const
Definition: SabertoothDriver.h:68
void drive(int power) const
Definition: SabertoothDriver.h:138
void setMaxVoltage(byte value) const
Definition: SabertoothDriver.h:175