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

defines common interface for all types of JMotorDrivers More...

#include <JMotorDriver.h>

Inheritance diagram for JMotorDriver:
Inheritance graph
[legend]

Public Member Functions

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
 

Detailed Description

defines common interface for all types of JMotorDrivers

Note
JMotorDriver's functions are virtual, it can not be used directly

Member Function Documentation

◆ disable()

bool JMotorDriver::disable ( )
inline

disable motor

Note
equivalent to setEnable(false)
Return values
(bool)true if state changed, false if state already set

◆ enable()

bool JMotorDriver::enable ( )
inline

enable motor

Note
equivalent to setEnable(true)
Return values
(bool)true if state changed, false if state already set

◆ getEnable()

virtual bool JMotorDriver::getEnable ( )
virtual

◆ getMaxRange()

virtual float JMotorDriver::getMaxRange ( )
virtual

◆ getMinRange()

virtual float JMotorDriver::getMinRange ( )
virtual

◆ set()

virtual bool JMotorDriver::set ( float  val)
virtual

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 in JMotorDriverAvrPWM, JMotorDriverAvrServo, JMotorDriverEsp32PWM, JMotorDriverEsp32Servo, JMotorDriverAvrHBridge, JMotorDriverAvrL293, JMotorDriverAvrPWMDir, JMotorDriverDual, JMotorDriverEsp32HBridge, JMotorDriverEsp32HBridgeTwoLedcChannels, JMotorDriverEsp32L293, JMotorDriverEsp32PWMDir, JMotorDriverServoAdvancedDual, JMotorDriverServoDual, and JMotorDriverTMC7300.

◆ setEnable()

virtual bool JMotorDriver::setEnable ( bool  _enable)
virtual

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 in JMotorDriverAvrHBridge, JMotorDriverAvrL293, JMotorDriverAvrPWM, JMotorDriverAvrPWMDir, JMotorDriverAvrServo, JMotorDriverDual, JMotorDriverEsp32HBridge, JMotorDriverEsp32HBridgeTwoLedcChannels, JMotorDriverEsp32L293, JMotorDriverEsp32PWM, JMotorDriverEsp32PWMDir, JMotorDriverEsp32Servo, JMotorDriverServoAdvancedDual, JMotorDriverServoDual, and JMotorDriverTMC7300.


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