1 #include <Servo.h> 2 3 Servo myservo; 4 5 void setup() { 6 myservo.attach(9); 7 Serial.begin(9600); 8 } 9 10 void loop() { 11 int value=40; 12 if (Serial.available() > 0) 13 { 14 value = Serial.read(); //reads the incoming byte 15 myservo.write(value); 16 } 17 }