commiting code that didnt work properly on new branch

This commit is contained in:
2026-09-18 12:25:51 +00:00
parent 285211fae6
commit aae5b19f83
6 changed files with 131 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
#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