My partner (Michael Hemati) and I, used the servo motors to lift our crawler and reset a walking “spring” of business cards which propelled the crawler as the servo legs were raised.
This design could be improved upon with a more directional friction interaction at the floor contacting end of the spring.
For the code instead of using the pulse width functionality, we used the servo.h library to use servopin.write() command as this allowed us greater control of the servo.
Video
https://drive.google.com/file/d/0B_zirL99HZRIMlNnaUdCYzVaODQ/edit?usp=sharing
Components used:
1 Phone case
1 Battery (for weight)
2 dowel rods
8 Business cards
2 180 degree servos
1 Arduino
1 breadboard
Rubber bands
Laptop
USB cord
4 Q-tips
Staples
Code:
#include <Servo.h>
Saervo servoR; // create servo object to control a servo
Servo servoL; // a maximum of eight servo objects can be created
int posR1 = 180; // variable to store the servo position
int posL1 = 40;
int posR2;
int posL2;
int angle = 70;
int start = 0;
int pause = 500;
void setup()
{
servoR.attach(7); // attaches the servo on pin 9 to the servo object
servoL.attach(8);
Serial.begin(9600);
}
void loop()
{
start = Serial.read();
start = start - '0';
if(start == 1){
servoL.write(posL1);
servoR.write(posR1);
delay(pause);
posL2 = posL1 + angle;
posR2 = posR1 - angle;
servoL.write(posL2);
servoR.write(posR2);
delay(pause);
servoL.write(posL1);
servoR.write(posR1);
//delay(1000);
}
}
- Login to post comments