Wave-Inator (Credit to Dr. Doofenshmirtz)
by simonfrfr in Circuits > Arduino
2155 Views, 2 Favorites, 0 Comments
Wave-Inator (Credit to Dr. Doofenshmirtz)
Hello and welcome to our first multibot based off of https://www.instructables.com/id/multi-bot-Basis/. Today we will show you Dr. Doofenshmirtz's new evil invention to better his feelings. This is called the Wave-Inator. (Prerequisites: Multibot Basis)
Submitted by Newton Labs for the Instructables Sponsorship Program
Submitted by Newton Labs for the Instructables Sponsorship Program
Supplies.
Parts:
Multibot basis
screws
2 servos
paper
Duct-tape
Tools:
screwdriver
scissors
Multibot basis
screws
2 servos
paper
Duct-tape
Tools:
screwdriver
scissors
Mount the Servos
Mount one servo with the two holders on the servo. Mount the second by, unscrewing the piece that rotates, then attaching it to the opposite side of the other servo.
Hand
Cut out a trace of your hand, and screw it into your other servo's mount.
Mount the Remaining Servo
Use Duct tape to attach the other Servo to the Plexiglass. Use counter weights if needed.
Wire It Up
Connect the Servo with the hand's yellow wire, to Arduino port 10, and the Other Servo's Yellow wire to Arduino Port 9. The Red on both of the Servos goes to +5V, and the Black goes to GND.
The Code*
* Copy paste this to your Arduino Program! You are Almost done!
#include <Servo.h>
Servo myservo; // create servo object to control a servo
Servo myservo2; // a maximum of eight servo objects can be created
int pos = 0; // variable to store the servo position
void setup()
{
myservo2.attach(10);
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop()
{
for(pos = 0; pos < 90; pos += 1) // goes from 0 degrees to 90 degrees
{
myservo2.write(pos); // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for(pos = 90; pos>=1; pos-=1) // goes from 90 degrees to 0 degrees
{
myservo2.write(pos);
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
#include <Servo.h>
Servo myservo; // create servo object to control a servo
Servo myservo2; // a maximum of eight servo objects can be created
int pos = 0; // variable to store the servo position
void setup()
{
myservo2.attach(10);
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop()
{
for(pos = 0; pos < 90; pos += 1) // goes from 0 degrees to 90 degrees
{
myservo2.write(pos); // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for(pos = 90; pos>=1; pos-=1) // goes from 90 degrees to 0 degrees
{
myservo2.write(pos);
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
Try It Out, You Are Done!
Thanks for taking your time to learn how to build one of doof's inators! Thanks Newton Labs Team. (Thanks to Starbot for the use of their facilities)