Fokkaði upp p2

This commit is contained in:
2026-09-17 12:20:06 +00:00
parent a54dbfbe2e
commit c355c232e6
9 changed files with 259 additions and 199 deletions
+16
View File
@@ -0,0 +1,16 @@
#ifndef MOTOR_DRIVER_H
#define MOTOR_DRIVER_H
class MotorDriver
{
public:
MotorDriver();
void begin();
void forward();
void reverse();
void stop();
};
#endif
+6
View File
@@ -1,6 +1,8 @@
#ifndef ROTARY_ENCODER_DRIVER_H
#define ROTARY_ENCODER_DRIVER_H
#include <stdint.h>
#include "digital_in.h"
#include "digital_out.h"
#include "timer_usec.h"
@@ -9,6 +11,7 @@ class RotaryEncoderDriver {
volatile uint8_t cycle;
volatile int16_t count;
volatile int16_t prev_count;
volatile bool speed_ready;
Digital_out led;
@@ -28,5 +31,8 @@ public:
float count_per_sec();
float rpm();
bool new_speed_available();
void reset_speed_measurement();
};
#endif