Paso 2: codificación
// Created by Gautam ( )// On February 22, 2016.#include<Servo.h>intpos=0;intinput=0;Servomyservo;voidsetup(){ Serial.begin(9600); myservo.attach(11);}voidloop(){ if(Serial.available()>0); { input=Serial.read(); { if(input=='1') { pos=pos+5; pos<=180; myservo.write(pos); } if(input=='0') { pos=pos-5; pos>=0; myservo.write(pos); } } }}