Init: Rattenfalle

This commit is contained in:
2024-01-27 23:32:45 +01:00
committed by Jakob Gegeniger
parent 3706823709
commit e82dd3f3a2
18 changed files with 1122 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
#pragma once
#include <Arduino.h>
#include <Servo.h>
#include <array>
#include "AbHal.hpp"
#include "DcMotor.hpp"
#include "Utils.hpp"
using TimeStamp = decltype(millis());
class ServoGrp {
public:
ServoGrp(int pin) : _pin(pin) {}
void attach() {
_srv.attach(_pin);
}
void detach() {
_srv.detach();
}
void write(int pos) {
_pos = pos;
_srv.write(_pos);
}
private:
Servo _srv;
int _pin;
int _pos{};
};