Skip to content
Snippets Groups Projects
Commit 780a72ef authored by Ethan Walters's avatar Ethan Walters
Browse files

Added minor commenting to servo controls

parent 8d29ee54
Branches
No related tags found
No related merge requests found
......@@ -42,8 +42,8 @@ void loop()
if (angle >= 0 && angle <= 180) {
myservo.attach(SERVO_PIN);
myservo.write(angle); // Move servo to specified angle
delay(1000);
myservo.detach();
delay(1000); // Wait for the servo to reach the position
myservo.detach(); // Detach servo to allow free spinning
Serial.print("Servo moved to: ");
Serial.println(angle);
} else {
......
......@@ -33,8 +33,8 @@ void loop() {
if (angle >= 0 && angle <= 180) {
myservo.attach(SERVO_PIN);
myservo.write(angle); // Move servo to specified angle
delay(1000);
myservo.detach();
delay(1000); // Wait for the servo to reach the position
myservo.detach(); // Detach servo to allow free spinning
Serial.print("Servo moved to: ");
Serial.println(angle);
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment