mirror of
https://github.com/zzzzDev4/IAS-Better-Tea.git
synced 2025-04-21 07:31:20 +02:00
19 lines
444 B
C++
19 lines
444 B
C++
#pragma once
|
|
#include <Servo.h>
|
|
|
|
class ContinuousServo
|
|
{
|
|
public:
|
|
ContinuousServo(int pin);
|
|
void moveServoForMillisClockwise(unsigned long duration);
|
|
void moveServoForMillisCounterClockwise(unsigned long duration);
|
|
void tick();
|
|
bool isTurning() { return m_isTurning; }
|
|
|
|
private:
|
|
Servo myservo;
|
|
bool m_isTurning = false;
|
|
unsigned long m_endTurningTime;
|
|
const int NEUTRAL_POS = 88;
|
|
const int speed = 10;
|
|
};
|