HW5_SEESAW_ZHANG

 

SEESAW

My project is using the 180 micro servo motor to create the sweep function. The first time come up in my mind is seesaw when I saw the “wings” are moving. So I used Illustrator to draw two kids who are playing this seesaw, and used the screw to fix the position of my drawing. To make it more fun, I also made a slot, and put a plastic bead in that slot. So every time the servo motor is moving, it makes the bead moving around, which is fun.

————————————————

CODE:

#include <Servo.h>
Servo myservo;
int pos = 0;
void setup()
{
myservo.attach(9);
}

void loop()
{
for(pos = 0; pos < 70; pos += 1)
{
myservo.write(pos);
delay(15);
}
for(pos = 70; pos>=1; pos-=1)
{
myservo.write(pos);
delay(15);
}
}

Leave a Reply

Your email address will not be published. Required fields are marked *