Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Testing/calibrating servo's with the Arduino - asks for a position and moves the servo there.
#include <Servo.h>
Servo myservo;
void setup() {
myservo.attach(3);
Serial.begin(9600);
myservo.write(90);
}
void loop() {
Serial.print("Enter position:");
while (Serial.available() == 0);// wait for serial
int pos = Serial.parseInt();
Serial.println(pos, 10);
myservo.write(pos);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.