Introduction: Dancing Spider

This project is a great project and simple to make. This can make Halloween a lot better. Who doesn't want a dancing spider in their house?!?!

Step 1: Parts You Will Need

1. Two servo motors

2. Some male wires

3. Breadboard

4. Ultra Sonic Distance sensor (not to use for its purpose just for it to look like eyes)

5. Arduino Uno

Step 2: Code You Will Need

#include

Servo myservo1; Servo myservo2; // create servo object to control a servo // create servo object to control a servo // twelve servo objects can be created on most boards

void setup() { myservo1.attach(9); // attaches the servo on pin 9 to the servo object

myservo2.attach(10); }

int pos = 0; // variable to store the servo position void loop() { for (pos = 0; pos <= 180; pos += 10) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo1.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position

} for (pos = 0; pos >= 180; pos -= 1) { // goes from 180 degrees to 0 degrees myservo2.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position }

int pos = 0; // variable to store the servo position for (pos = 180; pos <= 0; pos += 1) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo1.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position

} for (pos = 180; pos >= 0; pos -= 10) { // goes from 180 degrees to 0 degrees myservo2.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position }

Make It Move Contest 2017

Participated in the
Make It Move Contest 2017