[feature/ServoMotor] - change servo librarie

This commit is contained in:
2023-11-17 09:59:15 +01:00
parent 01b99d9716
commit 844cbf817c
3 changed files with 5 additions and 5 deletions

View File

@ -4,21 +4,21 @@ ServoMotorComponent::ServoMotorComponent(int PIN) {
this->PIN = PIN;
this->position = 0;
this->myservo.attach(PIN);
this->myservo.write(0);
}
void ServoMotorComponent::goLeft() {
this->myservo.write(0);
this->myservo.write(this->PIN, 0);
this->position = 0;
}
void ServoMotorComponent::goRight() {
this->myservo.write(180);
this->myservo.write(this->PIN, 180);
this->position = 180;
}
void ServoMotorComponent::goMiddle() {
this->myservo.write(90);
this->myservo.write(this->PIN, 90);
this->position = 90;
}