28 lines
400 B
C++
28 lines
400 B
C++
#ifndef SERVOMOTOT_COMPONENT_H
|
|
#define SERVOMOTOT_COMPONENT_H
|
|
|
|
#include <Servo.h>
|
|
|
|
class ServoMotorComponent
|
|
{
|
|
public:
|
|
ServoMotorComponent(int PIN);
|
|
~ServoMotorComponent() = default;
|
|
void goLeft();
|
|
void goRight();
|
|
void goMiddle();
|
|
int getPosition();
|
|
void setPin(int PIN);
|
|
|
|
private:
|
|
int PIN;
|
|
int position;
|
|
Servo myservo;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //SERVOMOTOT_COMPONENT_H
|