This robot is my version of keepon. It users two servos and an arduino uno to dance. I hope you enjoy and like the video.
dance
- Actuators / output devices: Servos
- Control method: autonomous
- CPU: arduino uno
- Operating system: Arduino
- Power source: USB
- Programming language: C++
- Sensors / input devices: none
- Target environment: indoor
This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/arduino-dancing-robot
A Favourite Song of Mine
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
** #include**
#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);
}
}
}