Froggy World 3 the Seesaw
by MikeTheMaker in Workshop > 3D Printing
2634 Views, 4 Favorites, 0 Comments
Froggy World 3 the Seesaw
Enter this code in the Arduino:
#include <Servo.h>
Servo myservo;
int start = 10;
int next = 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);
}}