Initial commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#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;
|
||||
};
|
||||
Reference in New Issue
Block a user