#pragma once #include #include "motor.h" class MotorControl : public Motor{ public: MotorControl(ShiftRegister* shiftRegister, uint8_t pwmPin, uint8_t dirPinA, uint8_t dirPinB, uint8_t endstopPinA, uint8_t endstopPinB); void loop(); bool start() override; bool getEndStopLeft(); bool getEndStopRight(); private: Direction endstopTouched = Direction::None; bool readPin(uint8_t pin); uint8_t endstopPinA; uint8_t endstopPinB; uint32_t lastMillis = 0; uint8_t loopDelay = 20; };