in most cases, JMotorDriverESP32HBridge is better, this driver uses two ledc (pwm) channels instead of efficiently using just one.
More...
#include <JMotorDriverEsp32HBridgeTwoLedcChannels.h>
|
| JMotorDriverEsp32HBridgeTwoLedcChannels (byte _pinPosCh, byte _pinPos, byte _pinNeg, byte _pinNegCh, bool _reverse=false, int _freq=2000, int _resolution=12, bool _invertSignals=false) |
|
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
|
|
bool | enable () |
| enable motor
|
|
bool | disable () |
| disable motor
|
|
in most cases, JMotorDriverESP32HBridge is better, this driver uses two ledc (pwm) channels instead of efficiently using just one.
◆ JMotorDriverEsp32HBridgeTwoLedcChannels()
JMotorDriverEsp32HBridgeTwoLedcChannels::JMotorDriverEsp32HBridgeTwoLedcChannels |
( |
byte |
_pinPosCh, |
|
|
byte |
_pinPos, |
|
|
byte |
_pinNeg, |
|
|
byte |
_pinNegCh, |
|
|
bool |
_reverse = false , |
|
|
int |
_freq = 2000 , |
|
|
int |
_resolution = 12 , |
|
|
bool |
_invertSignals = false |
|
) |
| |
|
inline |
◆ getEnable()
bool JMotorDriverEsp32HBridgeTwoLedcChannels::getEnable |
( |
| ) |
|
|
inlinevirtual |
get the enable state of the driver
- Return values
-
(bool) | true if enabled, false if disabled |
Reimplemented from JMotorDriver.
◆ getMaxRange()
float JMotorDriverEsp32HBridgeTwoLedcChannels::getMaxRange |
( |
| ) |
|
|
inlinevirtual |
high end of the range
- Note
- usually 1.0
- Return values
-
Reimplemented from JMotorDriver.
◆ getMinRange()
float JMotorDriverEsp32HBridgeTwoLedcChannels::getMinRange |
( |
| ) |
|
|
inlinevirtual |
low end of the range
- Note
- usually -1.0, if 0, that indicates a motor controller with no reverse function
- Return values
-
Reimplemented from JMotorDriver.
◆ set()
bool JMotorDriverEsp32HBridgeTwoLedcChannels::set |
( |
float |
val | ) |
|
|
inlinevirtual |
set motor power
- Note
- val should be between getMinRange and getMaxRange, but constrained internally
- Parameters
-
- Return values
-
(bool) | false if at end of power range, true otherwise |
Reimplemented from JMotorDriver.
◆ setEnable()
bool JMotorDriverEsp32HBridgeTwoLedcChannels::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.
◆ pwmDriverNeg
◆ pwmDriverPos
◆ reverse
bool JMotorDriverEsp32HBridgeTwoLedcChannels::reverse |
The documentation for this class was generated from the following file: