Introduction: Froggy World a 3D Printing Project
Step 1:
Here's the code:
#include <Servo.h>
Servo gate;
Servo bird;
int start=10;
int next=7;
int dummy=0;
int train=5;
int arrival=1;
int val=0;
int val2=0;
int birdin=9;
int birdout=8;
int birdmagnet=4;
int val3=5;
void setup()
{gate.attach (3);
bird.attach (2);
pinMode (next, OUTPUT);
pinMode (start, INPUT);
pinMode(arrival, INPUT);
pinMode (train, OUTPUT);
pinMode(birdin, INPUT);
pinMode(birdout, OUTPUT);
pinMode(birdmagnet, INPUT);
digitalWrite (next, HIGH);
digitalWrite (train, LOW);
digitalWrite (birdout, HIGH);
gate.write(130);
bird.write(170);
delay(1000);
}
void loop()
{val=digitalRead(start);
if(val==LOW or dummy==1)
{
gate.write(45);
bird.write(85);
delay (500);
digitalWrite(train,HIGH);
//if(dummy=0)
delay(5000);
dummy=2;}
else
{val2=digitalRead(birdmagnet);
if(val2==LOW)
{delay(1025);//delay from magnet to bird gate
digitalWrite (train, LOW);
bird.write(165);
val2=0;
dummy=0;
val=0;
delay(500);
digitalWrite (birdout, LOW);//start bird pickup
delay (500);
digitalWrite (birdout, HIGH);}
else
{val3=digitalRead(birdin);
if(val3==LOW or dummy==5)//signal that bird is done
{
gate.write(45);
bird.write(85);
digitalWrite(train,HIGH);
dummy=5;
val2=digitalRead(arrival);
if(val2==LOW)
//{delay(100);//delay from magnet to main gate
{digitalWrite (train, LOW);
gate.write(130);
val2=0;
dummy=0;
val=0;
digitalWrite (next, LOW);
delay (500);
digitalWrite (next, HIGH);
}}}}}
Step 2:
I had to add a backstop and block to control where the frog lands when he leaves the seesaw. I also added a couple of "wings" (3d printing raft) to the end of the seesaw to keep the frog from escaping.
3D design and print files are available at:
http://www.thingiverse.com/thing:70140
Step 3:
I added a bar at the bottom of the stop gate to reduce the chance of the engine "jumping" and derailing.
Step 4:
I changed the coupling between the small train engine and first car to reduce jumping problems on the train seesaw.
Step 5:
My wife felt that it would not be right to get into an amusement park without waiting for tickets!
Step 6:
The base evolved from plywood--to blue--to ocean color--to its current "swamp theme."
Step 7:
Overall, this has involved 3D printing, Arduino, electronics, design, oven-baked clay and art.
Thanks for stopping by Froggy World :)