Paso 16:
Introduce este código en el Arduino:
#include < Servo.h >
Servo myservo;
int Inicio = 10;
int siguiente = 7;
int val = 0;
void setup)
{pinMode(start,INPUT);
pinMode(next,OUTPUT);
digitalWrite(next,HIGH);
myservo.Attach(5);
myservo.Write(78);
Delay(1000);
}
void loop)
{val=digitalRead(start);
if(Val==Low)
{myservo.write(40);
Delay(1000);
myservo.Write(35);
Delay(500);
myservo.Write(30);
Delay(500);
myservo.Write(22);
Delay(3000);
myservo.Write(40);
Delay(1000);
myservo.Write(50);
Delay(500);
myservo.Write(60);
Delay(500);
myservo.Write(65);
Delay(500);
myservo.Write(70);
Delay(500);
myservo.Write(75);
Delay(500);
myservo.Write(78);
Delay(500);
digitalWrite (next, LOW);
Delay(500);
digitalWrite (next, HIGH);
}}