1#ifndef J_SERVO_CONTROLLER_ADVANCED_H
2#define J_SERVO_CONTROLLER_ADVANCED_H
51 JServoControllerAdvanced(
JMotorDriverServoAdvanced& _servo,
float _weakFreq = .5,
unsigned long _weakenTimeout = 0,
float _normalFreq = 1.0,
unsigned long _startWeakTimeout = 0,
bool _reverse =
false,
float velLimit = INFINITY,
float accelLimit = INFINITY,
float decelLimit = NAN,
unsigned long _disableTimeout = 0,
float _minAngleLimit = 0,
float _maxAngleLimit = 180,
float _pos = 90,
float _minSetAngle = 0,
float _maxSetAngle = 180,
int minServoVal = 544,
int maxServoVal = 2400,
bool _preventGoingWrongWay =
true,
bool _preventGoingTooFast =
true,
float _stoppingDecelLimit = INFINITY)
52 :
JServoController(_servo, _reverse, velLimit, accelLimit, decelLimit, _disableTimeout, _minAngleLimit, _maxAngleLimit, _pos, _minSetAngle, _maxSetAngle, minServoVal, maxServoVal, _preventGoingWrongWay, _preventGoingTooFast, _stoppingDecelLimit)
defines interface for servo driver with variable frequency, subclass of JMotorDriverServo and JMotorD...
Definition JMotorDriverServoAdvanced.h:8
virtual void adjustFrequency(float freq)=0
adjust frequency as a fraction of standard 50hz frequency lower frequencies (try ....
class for controlling JMotorDriverServoAdvanced, with power reducing option along with standard JServ...
Definition JServoControllerAdvanced.h:10
float getWeakFreq()
Definition JServoControllerAdvanced.h:159
unsigned long getStartWeakTimeout()
Definition JServoControllerAdvanced.h:155
bool getWeakened()
Definition JServoControllerAdvanced.h:136
float weakFreq
Definition JServoControllerAdvanced.h:20
void setStrengthNormal()
set servo to normal setting
Definition JServoControllerAdvanced.h:102
unsigned long getWeakenTimeout()
Definition JServoControllerAdvanced.h:147
void adjustServoFrequency(float freq=1.0)
adjust frequency as a fraction of standard 50hz frequency lower frequencies (try ....
Definition JServoControllerAdvanced.h:113
float defaultFreq
Definition JServoControllerAdvanced.h:19
unsigned long weakenTimeout
Definition JServoControllerAdvanced.h:18
void setStartWeakTimeout(unsigned long _timeout)
Definition JServoControllerAdvanced.h:151
void setNormalFreq(float _norm)
Definition JServoControllerAdvanced.h:129
void setWeakTimeout(unsigned long _timeout)
Definition JServoControllerAdvanced.h:143
unsigned long enabledMillis
Definition JServoControllerAdvanced.h:23
void setWeakFreq(float _weak)
change setting for what fraction of normal frequency the signal should go to in order to weaken the s...
Definition JServoControllerAdvanced.h:122
JServoControllerAdvanced(JMotorDriverServoAdvanced &_servo, float _weakFreq=.5, unsigned long _weakenTimeout=0, float _normalFreq=1.0, unsigned long _startWeakTimeout=0, bool _reverse=false, float velLimit=INFINITY, float accelLimit=INFINITY, float decelLimit=NAN, unsigned long _disableTimeout=0, float _minAngleLimit=0, float _maxAngleLimit=180, float _pos=90, float _minSetAngle=0, float _maxSetAngle=180, int minServoVal=544, int maxServoVal=2400, bool _preventGoingWrongWay=true, bool _preventGoingTooFast=true, float _stoppingDecelLimit=INFINITY)
Constructor for JServoControllerAdvanced, a class for controlling JMotorDriverServoAdvanced,...
Definition JServoControllerAdvanced.h:51
bool weakened
Definition JServoControllerAdvanced.h:21
bool setEnable(bool _enable)
enable or disable the servo (start or stop sending a signal to the servo)
Definition JServoControllerAdvanced.h:86
virtual void run()
call this in your main loop
Definition JServoControllerAdvanced.h:63
float getNormalFreq()
Definition JServoControllerAdvanced.h:163
void setStrengthWeak()
set servo to weaker setting
Definition JServoControllerAdvanced.h:94
JMotorDriverServoAdvanced & adServo
reference to the servo motor driver
Definition JServoControllerAdvanced.h:17
unsigned long startWeakTimeout
Definition JServoControllerAdvanced.h:22
class for controlling JMotorDriverServo, with angle calibration and accel and velocity limiting
Definition JServoController.h:12
virtual void run()
call this in your main loop
Definition JServoController.h:102
void writeAngleToServo(float ang)
Definition JServoController.h:602
unsigned long lastMovedMillis
variable used to keep track of how long the servo has been still for
Definition JServoController.h:47
virtual bool setEnable(bool _enable)
enable or disable the servo (start or stop sending a signal to the servo)
Definition JServoController.h:217
Derivs_Limiter dL
instance of Derivs_Limiter class used to smoothly move servo
Definition JServoController.h:63