JMotor
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
JMotorDriverServo Class Reference

class that can be used to specify a driver that controls specifically a servo More...

#include <JMotorDriverServo.h>

Inheritance diagram for JMotorDriverServo:
Inheritance graph
[legend]
Collaboration diagram for JMotorDriverServo:
Collaboration graph
[legend]

Public Member Functions

void setMinServoValue (int value)
 microseconds for shortest servo pulse
 
void setMaxServoValue (int value)
 microseconds for longest servo pulse
 
int getMinServoValue ()
 returns setting for microseconds for shortest servo pulse
 
int getMaxServoValue ()
 returns setting for microseconds for longest servo pulse
 
int getServoValueRange ()
 returns difference (in microseconds) between longest and shortest servo pulse settings
 
void setServoValues (int min, int max)
 set the settings for short and long servo pulses at the same time
 
int getSetMicroseconds ()
 returns how many microseconds the servo signal pulse was most recently set to
 
bool getConstrainRange ()
 returns whether the range of set() will be constrained to within -1 and 1
 
void setConstrainRange (bool _constrainRange)
 set whether the range of set() will be constrained to within -1 and 1
 
- Public Member Functions inherited from JMotorDriver
virtual bool set (float val)
 set motor power
 
virtual bool setEnable (bool _enable)
 use to enable or disable a motor, and sets up pin states
 
virtual bool getEnable ()
 get the enable state of the driver
 
virtual float getMaxRange ()
 high end of the range
 
virtual float getMinRange ()
 low end of the range
 
bool enable ()
 enable motor
 
bool disable ()
 disable motor
 

Protected Attributes

int minServoValue
 
int maxServoValue
 
int setMicroseconds = 0
 
bool constrainRange
 

Detailed Description

class that can be used to specify a driver that controls specifically a servo

Member Function Documentation

◆ getConstrainRange()

bool JMotorDriverServo::getConstrainRange ( )
inline

returns whether the range of set() will be constrained to within -1 and 1

Return values
(bool)

◆ getMaxServoValue()

int JMotorDriverServo::getMaxServoValue ( )
inline

returns setting for microseconds for longest servo pulse

Return values
(int)

◆ getMinServoValue()

int JMotorDriverServo::getMinServoValue ( )
inline

returns setting for microseconds for shortest servo pulse

Return values
(int)

◆ getServoValueRange()

int JMotorDriverServo::getServoValueRange ( )
inline

returns difference (in microseconds) between longest and shortest servo pulse settings

Return values
(int)

◆ getSetMicroseconds()

int JMotorDriverServo::getSetMicroseconds ( )
inline

returns how many microseconds the servo signal pulse was most recently set to

Return values
(int)

◆ setConstrainRange()

void JMotorDriverServo::setConstrainRange ( bool  _constrainRange)
inline

set whether the range of set() will be constrained to within -1 and 1

Parameters
_constrainRange(bool)

◆ setMaxServoValue()

void JMotorDriverServo::setMaxServoValue ( int  value)
inline

microseconds for longest servo pulse

Parameters
value(int)

◆ setMinServoValue()

void JMotorDriverServo::setMinServoValue ( int  value)
inline

microseconds for shortest servo pulse

Parameters
value(int)

◆ setServoValues()

void JMotorDriverServo::setServoValues ( int  min,
int  max 
)
inline

set the settings for short and long servo pulses at the same time

Parameters
min(int) microseconds, often 544
max(int) microseconds, often 2400

Member Data Documentation

◆ constrainRange

bool JMotorDriverServo::constrainRange
protected

◆ maxServoValue

int JMotorDriverServo::maxServoValue
protected

◆ minServoValue

int JMotorDriverServo::minServoValue
protected

◆ setMicroseconds

int JMotorDriverServo::setMicroseconds = 0
protected

how many microseconds the servo signal pulse was most recently set to


The documentation for this class was generated from the following file: