Fix methods

This commit is contained in:
Matt McWilliams 2024-06-30 13:41:28 -04:00
parent f2f3dd9127
commit 04d29ef2fe
2 changed files with 3 additions and 4 deletions

View File

@ -23,10 +23,10 @@ void TB6600MotorDriver::setup() {
pinMode(_pulsePin, OUTPUT);
digitalWrite(_directionPin, LOW);
digitalWrite(_enablePin, HIGH);
digitalWrite(_enablePin, _enabled ? HIGH : LOW);
}
void TB6600MotorDriver::setDirection(uint8_t direction) {
void TB6600MotorDriver::setDirection(bool direction) {
if (direction != _direction) {
_direction = direction;
_setDirection();

View File

@ -35,10 +35,9 @@ class TB6600MotorDriver {
TB6600MotorDriver();
TB6600MotorDriver(uint8_t enablePin, uint8_t directionPin, uint8_t pulsePin, uint32_t usPulse, uint8_t microsteps);
void setup();
void setDirection(uint8_t direction);
void setDirection(bool direction);
void setSpeed(uint16_t rpm);
//full