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

control two JMotorDriverServos as if they are one driver More...

#include <JMotorDriverServoDual.h>

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

Public Member Functions

 JMotorDriverServoDual (JMotorDriverServo &_m1, JMotorDriverServo &_m2)
 
bool set (float val)
 set motor power
 
bool setEnable (bool _enable)
 use to enable or disable a motor, and sets up pin states
 
bool getEnable ()
 get the enable state of the driver
 
float getMaxRange ()
 high end of the range
 
float getMinRange ()
 low end of the range
 
void setMinServoValue (int value)
 
void setMaxServoValue (int value)
 
int getMinServoValue ()
 
int getMaxServoValue ()
 
int getServoValueRange ()
 
void setServoValues (int min, int max)
 
- Public Member Functions inherited from JMotorDriverServo
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
bool enable ()
 enable motor
 
bool disable ()
 disable motor
 

Public Attributes

JMotorDriverServom1
 
JMotorDriverServom2
 

Additional Inherited Members

- Protected Attributes inherited from JMotorDriverServo
int minServoValue
 
int maxServoValue
 
int setMicroseconds = 0
 
bool constrainRange
 

Detailed Description

control two JMotorDriverServos as if they are one driver

Note
one (or both) of the drivers may be another dual driver allowing for controlling more than two servos together

Constructor & Destructor Documentation

◆ JMotorDriverServoDual()

JMotorDriverServoDual::JMotorDriverServoDual ( JMotorDriverServo _m1,
JMotorDriverServo _m2 
)
inline

Member Function Documentation

◆ getEnable()

bool JMotorDriverServoDual::getEnable ( )
inlinevirtual

get the enable state of the driver

Return values
(bool)true if enabled, false if disabled

Reimplemented from JMotorDriver.

◆ getMaxRange()

float JMotorDriverServoDual::getMaxRange ( )
inlinevirtual

high end of the range

Note
usually 1.0
Return values
(float)maxRange

Reimplemented from JMotorDriver.

◆ getMaxServoValue()

int JMotorDriverServoDual::getMaxServoValue ( )
inline

◆ getMinRange()

float JMotorDriverServoDual::getMinRange ( )
inlinevirtual

low end of the range

Note
usually -1.0, if 0, that indicates a motor controller with no reverse function
Return values
(float)minRange

Reimplemented from JMotorDriver.

◆ getMinServoValue()

int JMotorDriverServoDual::getMinServoValue ( )
inline

◆ getServoValueRange()

int JMotorDriverServoDual::getServoValueRange ( )
inline

◆ set()

bool JMotorDriverServoDual::set ( float  val)
inlinevirtual

set motor power

Note
val should be between getMinRange and getMaxRange, but constrained internally
Parameters
val(float) val
Return values
(bool)false if at end of power range, true otherwise

Reimplemented from JMotorDriver.

◆ setEnable()

bool JMotorDriverServoDual::setEnable ( bool  _enable)
inlinevirtual

use to enable or disable a motor, and sets up pin states

Note
setEnable(true) must be called before a motor driver will activate
Parameters
_enable(bool) true=enable, false=disable
Return values
(bool)true if state changed, false if state already set

Reimplemented from JMotorDriver.

◆ setMaxServoValue()

void JMotorDriverServoDual::setMaxServoValue ( int  value)
inline

◆ setMinServoValue()

void JMotorDriverServoDual::setMinServoValue ( int  value)
inline

◆ setServoValues()

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

Member Data Documentation

◆ m1

JMotorDriverServo& JMotorDriverServoDual::m1

◆ m2

JMotorDriverServo& JMotorDriverServoDual::m2

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