Make: Arduino bots and gadgets Insect Bot not working

So I made the Insect Bot and did the code. I then ran it, connected the battery and ta da I thought, but it went one way slowly then the other way slowly. What am I doing wrong

What am I doing wrong

No links. No schematics. No pictures. No code.

A more reasonable question would be what you are doing right. Not much would be the answer.

Can you just help me? search up the schematic. Is it a problem with the servos?

Can you just help me?

No. All that you have said is "it doesn't work".

search up the schematic.

Excuse me. Who needs the help here? My robot is working fine.

Is it a problem with the servos?

Or the batteries. Or the wiring. Or the axles, wheels, frog legs, or chocolate ice cream. Or the code. Who the hell knows. No one else can see what you are doing.

https://www.google.com/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0CAcQjRxqFQoTCLHRkIvZl8kCFRTdYwod6ysPrQ&url=https%3A%2F%2Fwww.safaribooksonline.com%2Flibrary%2Fview%2Fmake-arduino-bots%2F9781449304911%2Fch04.html&psig=AFQjCNFhJxbWYUy9V8sRQkg7pqrQsonW9g&ust=1447857875691949

Thats the schematic.

but it went one way slowly then the other way slowly.

What we're your expectations? You'll have to be more forthcoming - not everyone has your book or hardware.

There are several programs listed on the page you (sort of) linked to.

Which program did you use?

As the authors point out in the book, the program may need to be adjusted to work well with your robot.

So, how do I adjust my program? did you make this too?

RobotGuy13: So, how do I adjust my program?

We don't know. We can't see your programming.

Servo frontServo;
Servo rearServo;
/* Servo motors - global variables */
int centerPos = 90;
int frontRightUp = 72;
int frontLeftUp = 108;
int backRightForward = 75;
int backLeftForward = 105;
int walkSpeed = 150; // How long to wait between steps in milliseconds
int centerTurnPos = 81;
int frontTurnRightUp = 63;
int frontTurnLeftUp = 117;
int backTurnRightForward = 66;
int backTurnLeftForward = 96;

/* Ping distance measurement - global variables */
int pingPin = 4;
long int duration, distanceInches;
long distanceFront=0; //cm
int startAvoidanceDistance=20; //cm

long microsecondsToInches(long microseconds)
{
return microseconds / 74 / 2;
}

long microsecondsToCentimeters(long microseconds)
{
return microseconds / 29 / 2;
}

long distanceCm(){
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(5);
digitalWrite(pingPin, LOW);

pinMode(pingPin, INPUT);
duration = pulseIn(pingPin, HIGH);

distanceInches = microsecondsToInches(duration);
return microsecondsToCentimeters(duration);
}

void center()
{
frontServo.write(centerPos);
rearServo.write(centerPos);
}

void moveForward()
{
frontServo.write(frontRightUp);
rearServo.write(backLeftForward);
delay(125);
frontServo.write(centerPos);
rearServo.write(centerPos);
delay(65);
frontServo.write(frontLeftUp);
rearServo.write(backRightForward);
delay(125);

frontServo.write(centerPos);
rearServo.write(centerPos);
delay(65);
}

void moveBackRight()
{
frontServo.write(frontRightUp);
rearServo.write(backRightForward-6);
delay(125);
frontServo.write(centerPos);
rearServo.write(centerPos-6);
delay(65);
frontServo.write(frontLeftUp+9);
rearServo.write(backLeftForward-6);
delay(125);

frontServo.write(centerPos);
rearServo.write(centerPos);
delay(65);
}

void moveTurnLeft()
{
frontServo.write(frontTurnRightUp);
rearServo.write(backTurnLeftForward);
delay(125);
frontServo.write(centerTurnPos);
rearServo.write(centerTurnPos);
delay(65);
frontServo.write(frontTurnLeftUp);
rearServo.write(backTurnRightForward);
delay(125);

frontServo.write(centerTurnPos);
rearServo.write(centerTurnPos);
delay(65);
}

void setup()
{
frontServo.attach(2);
rearServo.attach(3);
pinMode(pingPin, OUTPUT);
}

void loop()
{
distanceFront=distanceCm();
if (distanceFront > 1){ // Filters out any stray 0.00
if (distanceFront<startAvoidanceDistance) {
for(int i=0; i<=8; i++) {
moveBackRight();
delay(walkSpeed);
}
for(int i=0; i<=10; i++) {
moveTurnLeft();
delay(walkSpeed);
}
} else {
moveForward();
delay(walkSpeed);
}
}
}

RobotGuy13:
So, how do I adjust my program?

The book you linked provides instructions on how to adjust the legs of the bot and how to adjust the program.

RobotGuy13:
did you make this too?

I haven’t made one myself but I’ve seen videos of these sorts of robots and I know they can be very difficult to get to work properly. The shape of the legs is very important and I think the surface the robot is walking on is also important. Servo motion is another important detail in getting the robot to walk.

So it is a problem with the servos? the servos go slowly one way, then the other slowly, then stop and make a buzzing noise

RobotGuy13: So it is a problem with the servos? the servos go slowly one way, then the other slowly, then stop and make a buzzing noise

It's hard to say.

The directions say to use a 9V battery to power the robot. I think a 9V battery doesn't make a good power supply for servos. One possible problem could be caused by not having enough power. Another possible problem could be using continuous rotation servos instead of normal servos.

If you could make a video to post to YouTube, we could see how your bot is behaving and try to make suggestions on how to improve it.

If you use a phone to make a video, please hold the phone sideways so the video is the normal size, not tall and skinny.

I will try to get a video to work but what difference does it make that i use cont. rotation servos to normal servos. I am using one of each.

RobotGuy13: I will try to get a video to work but what difference does it make that i use cont. rotation servos to normal servos. I am using one of each.

It makes a big difference.

It would have been nice if you had told us this earlier.

So what should I use? whats the best combination of materials?

RobotGuy13: So what should I use? whats the best combination of materials?

What does the book suggest?

Whats the best parts I can use? could you list or link the parts that work best for this robot?

You're the guy with the book. What does the book say?

The book is not specific enough. Someone will have to point out the best materials.