Let's Make Robots!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ossipee's picture

That was fun thanks

ossippe

Azza's picture

code? :)

SimpleBotics's picture

 

#include <Servo.h>

Servo1;

Servo2;

 

int posf1 = 90;

int posf2 = 90;

 

void setup()

{

servo1.attach(9);

servo2.attach(6);

}

 

void loop()

 

{

 for(posf1 = 90; posf1 < 130; posf1 += 1)

 {

   servo1.write(posf1);

   delay(250);

 }

 for(posl1 = 90; posl1 < 130; posl1 += 1)

 {

  servo2.write(posl1);

   delay(250);

 }

 for(posf1 = 130; posf1>=90; posf1 -=1)

 {

  servo1.write(posf1);

   delay(250);

 }

 

 for(posf2 = 90; posf2 < 50; posf2 += 1)

 {

 servo2.write(posf2);

   delay(250);

 }

 for(posl2 = 90; posl2 < 50; posl2 += 1)

 {

  servo2.write(posl2);

   delay(250);

 }

 for(posf1 = 50; posf1>=90; posf1 -=1)

 {

  servo1.write(posf2);

   delay(250);

 }

}

}

 

driguana2000's picture

I've always felt that every robot should have a purpose.  Dancing is every bit as important as welding car frames and it made me smile.  Thanks.

 

Dr. Iguana

SimpleBotics's picture

youre welcome