|
RSeries astromech firmware
|
|
Go to the documentation of this file.
52 virtual void stop()
override
65 virtual void motor(
float left,
float right,
float throttle)
override
67 left =
map(left, -1.0f, 1.0f, 0.0f, 1.0f);
68 right =
map(right, -1.0f, 1.0f, 0.0f, 1.0f);
70 Serial.print(
"M "); Serial.print(left); Serial.print(
", "); Serial.print(right);Serial.print(
", "); Serial.println(throttle);
92 static float map(
float x,
float in_min,
float in_max,
float out_min,
float out_max)
94 return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
virtual bool hasThrottle() override
Definition: TankDrivePWM.h:87
uint8_t fLeft
Definition: TankDrivePWM.h:61
ServoDispatch & fDispatch
Definition: TankDrivePWM.h:60
void driveStick(JoystickController *stick, float speedModifier)
Definition: TankDrive.h:346
void moveTo(uint16_t num, uint32_t startDelay, uint32_t moveTime, float pos)
Definition: ServoDispatch.h:132
void setMaxSpeed(float modifier)
Definition: TankDrive.h:137
virtual void motor(float left, float right, float throttle) override
Definition: TankDrivePWM.h:65
Base template of automatic forwarder from i2c to CommandEvent.
Definition: TankDrive.h:37
int fThrottle
Definition: TankDrivePWM.h:63
Base template of automatic forwarder from i2c to CommandEvent.
Definition: TankDrivePWM.h:22
Servo interace implemented eitehr by ServoDispatchPCA9685 or ServoDispatchDirect.
Definition: ServoDispatch.h:83
Definition: JoystickController.h:4
virtual void stop() override
Definition: TankDrivePWM.h:52
TankDrivePWM(ServoDispatch &dispatch, uint8_t leftNum, uint8_t rightNum, int throttleNum, JoystickController &driveStick)
Constructor.
Definition: TankDrivePWM.h:38
static float map(float x, float in_min, float in_max, float out_min, float out_max)
Definition: TankDrivePWM.h:92
uint8_t fRight
Definition: TankDrivePWM.h:62
virtual void stop()
Definition: TankDrive.h:261
TankDrivePWM(ServoDispatch &dispatch, uint8_t leftNum, uint8_t rightNum, JoystickController &driveStick)
Constructor.
Definition: TankDrivePWM.h:29
virtual void setup() override
Subclasses must implement this function to perform any necessary setup that cannot happen in the cons...
Definition: TankDrivePWM.h:48