Files

18 lines
400 B
C++

#ifndef MOTOR_DRIVER_H
#define MOTOR_DRIVER_H
#include <stdint.h>
// Vélbúnaðar-PWM á Timer1: AIN1 = OC1A = PB1 (D9), AIN2 = OC1B = PB2 (D10)
class Motor_driver {
public:
Motor_driver();
void init(uint16_t top = 799); //
void set_duty_cycleA(int percent); // 0-100%, AIN1
void set_duty_cycleB(int percent); // 0-100%, AIN2
private:
uint16_t top_value;
};
#endif