Init: Rattenfalle
This commit is contained in:
@@ -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{};
|
||||
};
|
||||
Reference in New Issue
Block a user