wpi-32u4-library
|
#include <Romi32U4Motors.h>
Inherits Romi32U4Motor.
Public Member Functions | |
void | setMotorEffort (int16_t effort) |
![]() | |
Romi32U4Motor (void) | |
void | setPIDCoeffients (float kp, float ki) |
void | allowTurbo (bool turbo) |
Turns turbo mode on or off. More... | |
void | handleISR (bool newA, bool newB) |
Protected Member Functions | |
void | setEffort (int16_t effort) |
Sets the effort for the motor directly. Overloaded for the left and right motors. Use Chassis::setEfforts() from the user code to control motor efforts directly. More... | |
![]() | |
virtual void | setEffort (int16_t effort)=0 |
Sets the effort for the motor directly. Overloaded for the left and right motors. Use Chassis::setEfforts() from the user code to control motor efforts directly. More... | |
int16_t | getCount (void) |
int16_t | getAndResetCount (void) |
void | setTargetSpeed (float targetSpeed) |
void | moveFor (int16_t amount) |
bool | checkComplete (void) |
void | update (void) |
void | calcEncoderDelta (void) |
Additional Inherited Members | |
![]() | |
static void | init () |
![]() | |
enum | CTRL_MODE : uint8_t { CTRL_DIRECT , CTRL_SPEED , CTRL_POS } |
![]() | |
static void | initMotors () |
static void | initEncoders () |
![]() | |
volatile CTRL_MODE | ctrlMode = CTRL_DIRECT |
volatile int16_t | speed = 0 |
float | targetSpeed = 0 |
int16_t | targetPos = 0 |
int16_t | maxEffort = 300 |
volatile int16_t | prevCount = 0 |
volatile int16_t | count = 0 |
volatile int16_t | lastA = 0 |
volatile int16_t | lastB = 0 |
PIDController | pidCtrl |
A derived class for the right motor.
Definition at line 149 of file Romi32U4Motors.h.
|
protectedvirtual |
Sets the effort for the motor directly. Overloaded for the left and right motors. Use Chassis::setEfforts() from the user code to control motor efforts directly.
effort | A number from -300 to 300 representing the effort and direction of the left motor. Values of -300 or less result in full effort reverse, and values of 300 or more result in full effort forward. |
Implements Romi32U4Motor.
Definition at line 80 of file Romi32U4Motors.cpp.
References Romi32U4Motor::maxEffort, and FastGPIO::Pin< pin >::setOutput().
Referenced by setMotorEffort().
|
inline |
Used to set the motor effort directly. It will properly control the mode.
Definition at line 156 of file Romi32U4Motors.h.
References Romi32U4Motor::CTRL_DIRECT, Romi32U4Motor::ctrlMode, and setEffort().
Referenced by Chassis::setMotorEfforts().