RoboidControl-cpp/Motor.cpp
Pascal Serrarens 189ea6c689 Initial commit
2023-11-06 14:24:18 +01:00

26 lines
693 B
C++

#include <Motor.h>
Motor::Motor() {
this->isSensor = false;
}
// Motor::Motor(uint8_t pinIn1, uint8_t pinIn2) {
// this->pinIn1 = pinIn1;
// this->pinIn2 = pinIn2;
// pinMode(pinIn1, OUTPUT); // configure the in1 pin to output mode
// pinMode(pinIn2, OUTPUT); // configure the in2 pin to output mode
// }
// void Motor::SetDirection(Direction direction) {
// digitalWrite(pinIn1, direction);
// digitalWrite(pinIn2, !direction); // This is the opposite of pinIn1
// }
// void Motor::SetSpeed(float speed) { // 0..1
// currentSpeed = speed;
// uint8_t motorSignal = (uint8_t)(speed * 255);
// analogWrite(pinIn1, speed);
// analogWrite(pinIn2, 255 - speed);
// }