1#ifndef J_MOTOR_DRIVER_ESP32_HBRIDGE_H
2#define J_MOTOR_DRIVER_ESP32_HBRIDGE_H
39 JMotorDriverEsp32HBridge(
byte _ledCChannel,
byte _pinPos,
byte _pinNeg,
bool _reverse =
false,
int _freq = 2000,
int _resolution = 12,
bool _invertSignals =
false)
76 return abs(val) < 1.0;
123 digitalWrite(
pinPos, LOW);
124 digitalWrite(
pinNeg, LOW);
150 digitalWrite(pin, state);
Controls an H-bridge motor driver with two pins When wiring to an L293D or similar motor driver,...
Definition JMotorDriverEsp32HBridge.h:11
int PWM_RES
Definition JMotorDriverEsp32HBridge.h:18
byte ch
Definition JMotorDriverEsp32HBridge.h:23
float getMaxRange()
high end of the range
Definition JMotorDriverEsp32HBridge.h:132
int PWM_RANGE
Definition JMotorDriverEsp32HBridge.h:19
JMotorDriverEsp32HBridge(byte _ledCChannel, byte _pinPos, byte _pinNeg, bool _reverse=false, int _freq=2000, int _resolution=12, bool _invertSignals=false)
Controls an H-bridge motor driver with two pins When wiring to an L293D or similar motor driver,...
Definition JMotorDriverEsp32HBridge.h:39
bool set(float val)
set motor power
Definition JMotorDriverEsp32HBridge.h:51
bool invertSignals
Definition JMotorDriverEsp32HBridge.h:15
bool setEnable(bool _enable)
use to enable or disable a motor, and sets up pin states
Definition JMotorDriverEsp32HBridge.h:78
float getMinRange()
low end of the range
Definition JMotorDriverEsp32HBridge.h:136
bool reverse
Definition JMotorDriverEsp32HBridge.h:14
void writePWM(byte ch, int val)
just ledcWrite, but with invertSignals
Definition JMotorDriverEsp32HBridge.h:155
byte pinNeg
Definition JMotorDriverEsp32HBridge.h:22
bool getEnable()
get the enable state of the driver
Definition JMotorDriverEsp32HBridge.h:128
int PWM_FREQ
Definition JMotorDriverEsp32HBridge.h:17
bool enabled
Definition JMotorDriverEsp32HBridge.h:13
void setFrequencyAndResolution(int freq=2000, int resBits=12)
set frequency of pwm
Definition JMotorDriverEsp32HBridge.h:111
byte pinPos
Definition JMotorDriverEsp32HBridge.h:21
void write(byte pin, bool state)
just digitalWrite, but with invertSignals
Definition JMotorDriverEsp32HBridge.h:145
defines common interface for all types of JMotorDrivers
Definition JMotorDriver.h:10