- 6th graders learn to build a Spider robot
- Parts list for Spider
- 1 Spider parts and tools
- 2 Hacking Spider's click n' stick
- 3 Creating the battery and motor mounts for Spider
- 4 Attach Spider's click n' stick base to the batteries and thread his wires
- 5 Attach Spider's motor controller and wire his motors
- 6 Connect Spider's power switch and run the power wires to the motor controller
- 7 Attach and adjust the Spider's bezel
- 8 Attach Spider's wheels
- 9 Make the connnectors for Spider's Arduino Nano
- 10 Spider Connect the power and signal wires from the motor controller to the Arduino
- 11 Attach Spider's LED eyes
- 12 Connect Spider's stablizer bar
- 13 Spider's Romance
- 14 Teaching Spider to dance
- 15 Ben Eater's Spider Bot
14 Teaching Spider to dance
Teaching Spider how to dance
Now its time to teach Spider to dance
1. Go to: http://arduino.cc/en/main/software and download the Arduino software for your computer's operating system
2. Launch Arduino and then go to file new

3. Go to tools and select Arduino Nano w/ ATmega328

4.Connect the USB mini cable to your computer and the Arduino on your Spider bot
5. Select the following serial port

6. Copy the dance code shown below (select it and use control c on a pc or command c on a mac)
//DANCE CODE for Spider by Karl Wendt 1/15/13
//Define the pin outs
int Red_Eye_Left= 12; // LED connected to pin 12
int Red_Eye_Right= 4; // LED connected to pin 4
int Green_Eye_Left= 8; // LED connected to pin 8
int Green_Eye_Right= 3; // LED connected to pin 3
int Blue_Eye_Left= 7; // LED connected to pin 7
int Blue_Eye_Right= 2; // LED connected to pin 2
int Left_Reverse = 6; // Right motor control 1 connected to pin 6
int Left_Forward = 9; // Right motor control 2 connected to pin 9
int Right_Forward = 10; // Left motor control 1 connected to pin 10
int Right_Reverse = 11; // Left motor control 2 connected to pin 11
//Set the mode of the pin (output or input)
void setup()
{
pinMode(Red_Eye_Left, OUTPUT); //sets the digital pin as output
pinMode(Red_Eye_Right, OUTPUT); //sets the digital pin as output
pinMode(Green_Eye_Left, OUTPUT); //sets the digital pin as output
pinMode(Green_Eye_Right, OUTPUT); //sets the digital pin as output
pinMode(Blue_Eye_Left, OUTPUT); //sets the digital pin as output
pinMode(Blue_Eye_Right, OUTPUT); //sets the digital pin as output
pinMode(Left_Forward, OUTPUT); // sets L1 the digital pin as output
pinMode(Left_Reverse, OUTPUT); // sets L2 the digital pin as output
pinMode(Right_Forward, OUTPUT); // sets L3 the digital pin as output
pinMode(Right_Reverse, OUTPUT); // sets L4 the digital pin as output
}
//Create your code loop
void loop()
{
digitalWrite(Red_Eye_Left, HIGH); //turns on left eye red LED
digitalWrite(Red_Eye_Right, HIGH); //turns on right eye red LED
delay(500); //run for half a second
digitalWrite(Red_Eye_Left, LOW); //turns off left eye red LED
digitalWrite(Red_Eye_Right, LOW); //turns off right eye red LED
digitalWrite(Green_Eye_Left, HIGH); //turns on left eye green LED
delay(500); //run for half a second
digitalWrite(Green_Eye_Left, LOW); //turns off left eye green LED
digitalWrite(Blue_Eye_Left, HIGH); //turns on left eye blue LED
delay(500); //run for half a second
digitalWrite(Blue_Eye_Left, LOW); //turns on left eye blue LED
delay(500); //run for half a second
digitalWrite(Green_Eye_Right, HIGH); //turns on right eye green LED
delay(500); //run for half a second
digitalWrite(Green_Eye_Right, LOW); //turns off right eye green LED
digitalWrite(Blue_Eye_Right, HIGH); //turns on right eye blue LED
delay(500); //run for half a second
digitalWrite(Blue_Eye_Right, LOW); //turns off right eye blue LED
delay(500); //run for half a second
//Make new colors by combining LED lights
digitalWrite(Blue_Eye_Left, HIGH); //turns on left eye blue LED
digitalWrite(Blue_Eye_Right, HIGH); //turns on right eye blue LED
digitalWrite(Red_Eye_Left, HIGH); //turns on left eye red LED
digitalWrite(Red_Eye_Right, HIGH); //turns on right eye red LED
delay(1000); //run for a quarter second
digitalWrite(Blue_Eye_Left, LOW); //turns on left eye blue LED
digitalWrite(Blue_Eye_Right, LOW); //turns on right eye blue LED
digitalWrite(Green_Eye_Left, HIGH); //turns on left eye green LED
digitalWrite(Green_Eye_Right, HIGH); //turns on right eye green LED
digitalWrite(Red_Eye_Left, HIGH); //turns on left eye red LED
digitalWrite(Red_Eye_Right, LOW); //turns on right eye red LED
delay(1000); //run for a quarter second
//Turn on the motors and make Spider move
analogWrite(Left_Reverse, 90); //run left motor backwards at PWM speed 90
delay(500); //run for half a second
analogWrite(Left_Reverse, 0); //stop left motor
delay(200); //run for 2 seconds
analogWrite(Right_Reverse, 90); //run right motor backwards at PWM speed 90
delay(500); //run for half a second
analogWrite(Right_Reverse, 0); //stop right motor
analogWrite(Left_Forward, 90); //run left motor forward at PWM speed 90
delay(500); //wait for half a second
analogWrite(Left_Forward, 0); //stop left motor
analogWrite(Right_Forward, 90); //run right motor forward at PWM speed 90
delay(500); //run for half a second
analogWrite(Right_Forward, 0); //stop right motor
analogWrite(Left_Reverse, 90); //run left motor backwards at PWM speed 90
delay(500); //run for half a second
analogWrite(Left_Reverse, 0); //stop left motor
delay(200); //run for 2 seconds
analogWrite(Right_Reverse, 90); //run right motor backwards at PWM speed 90
delay(500); //run for half a second
analogWrite(Right_Reverse, 0); //stop right motor
analogWrite(Left_Forward, 90); //run left motor forward at PWM speed 90
delay(500); //wait for half a second
analogWrite(Left_Forward, 0); //stop left motor
analogWrite(Right_Forward, 90); //run right motor forward at PWM speed 90
delay(500); //run for half a second
analogWrite(Right_Forward, 0); //stop right motor
}
}
7. Paste the code into the new Arduino file you just created (place the cursor into your Arduino sketch and press control v or command v)
8.Upload the code to your Spider Bot by clicking on the horizontal arrow

9. Unplug the USB cable
10. Turn you spider on and watch him go!
11. You may need to increase the motor speed if your spider is not moving fast enough.
CAUTION: Be sure your Spider Bot is on a smooth flat floor (NOT A TABLE TOP) he is NOT programmed yet to avoid the edges of the table and he will fall and may break.
Share a tip
Suggest a fix
Have something that's not a tip or feedback about this content?
This discussion area is not meant for answering homework questions.