2022-01-17 19:41:08 +00:00
|
|
|
#ifndef MOTOR_H
|
|
|
|
#define MOTOR_H
|
|
|
|
|
2021-12-14 19:07:55 +00:00
|
|
|
#include <Arduino.h>
|
|
|
|
|
|
|
|
class Motor
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
uint8_t pwm_pin;
|
|
|
|
uint8_t in1_pin;
|
|
|
|
uint8_t in2_pin;
|
|
|
|
|
|
|
|
public:
|
|
|
|
Motor(uint8_t pwm_pin, uint8_t in1_pin, uint8_t in2_pin);
|
|
|
|
void setup();
|
|
|
|
void run(uint8_t speed, bool forward);
|
|
|
|
void stop(bool freewheel);
|
|
|
|
};
|
2022-01-17 19:41:08 +00:00
|
|
|
|
|
|
|
#endif
|