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

Picture of 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 }

Comments

tliguori330 (author)2017-11-08

Really cool, thanks for the ideas. I can see this going a lot of different ways

Swansong (author)2017-11-08

That's a fun setup :) Are you going to make a shell or casing to make it a spider?

About This Instructable

76views

1favorite

License:

More by ozziemotechin:Dancing Spider
Add instructable to: