Hi I got a Dagu quadbot and a Dagu spider controller and am trying to adapt the quaruped2 code to make it move but I havent had much success,What does FLHservo,FLKservo mean ? I get the front left bit and I think I have assigned them the correct pin in the code as follows,
#include <Servo.h>
#include "Constants.h"
#include "IOpins.h"
// define global variables and servos here
int Time=100;
int LShift=350;
int RShift=350;
int Raise=700;
Servo FLHservo; // define servos
Servo FRHservo;
Servo RLHservo;
Servo RRHservo;
Servo FLKservo;
Servo FRKservo;
Servo RLKservo;
Servo RRKservo;
void setup()
{
FLHservo.attach(FLHpin); // attach servos
FRHservo.attach(FRHpin);
RLHservo.attach(RLHpin);
RRHservo.attach(RRHpin);
FLKservo.attach(FLKpin);
FRKservo.attach(FRKpin);
RLKservo.attach(RLKpin);
RRKservo.attach(RRKpin);
FLHservo.writeMicroseconds(FLHcenter); // center servos
FRHservo.writeMicroseconds(FRHcenter);
RLHservo.writeMicroseconds(RLHcenter);
RRHservo.writeMicroseconds(RRHcenter);
FLKservo.writeMicroseconds(FLKcenter);
FRKservo.writeMicroseconds(FRKcenter);
RLKservo.writeMicroseconds(RLKcenter);
RRKservo.writeMicroseconds(RRKcenter);
delay(2000);
//Serial.begin(9600);
}
void loop()
{
// run forwards
LShift=350;
RShift=350;
for(int i=0;i<10;i++)
{
Run();
}
// turn left
LShift=-350;
RShift=350;
for(int i=0;i<10;i++)
{
Run();
}
// run backward
LShift=-350;
RShift=-350;
for(int i=0;i<10;i++)
{
Run();
}
// turn right
LShift=350;
RShift=-350;
for(int i=0;i<10;i++)
{
Run();
}
}
void Run()
{
FRKservo.writeMicroseconds(FRKcenter+Raise); // raise front right leg
RLKservo.writeMicroseconds(RLKcenter+Raise); // raise rear left leg
FLHservo.writeMicroseconds(FLHcenter+LShift); // move front left leg backward
RRHservo.writeMicroseconds(RRHcenter-RShift); // move rear right leg backward
delay(Time/2);
FRHservo.writeMicroseconds(FRHcenter+RShift); // move front right leg forward
RLHservo.writeMicroseconds(RLHcenter-LShift); // move rear left leg forward
delay(Time);
FRKservo.writeMicroseconds(FRKcenter); // lower front right leg
RLKservo.writeMicroseconds(RLKcenter); // lower rear left leg
delay(Time);
FLKservo.writeMicroseconds(FLKcenter+Raise); // raise front left leg
RRKservo.writeMicroseconds(RRKcenter+Raise); // raise rear right leg
FRHservo.writeMicroseconds(FRHcenter-RShift); // move front right leg backward
RLHservo.writeMicroseconds(RLHcenter+LShift); // move rear left leg backward
delay(Time/2);
FLHservo.writeMicroseconds(FLHcenter-LShift); // move front left leg forward
RRHservo.writeMicroseconds(RRHcenter+RShift); // move rear right leg forward
delay(Time);
FLKservo.writeMicroseconds(FLKcenter); // lower front left leg
RRKservo.writeMicroseconds(RRKcenter); // lower rear right leg
delay(Time);
}
I have edited IOpins.h to reflect the pins used. When its connected to usb it does nothing just wriggles but when connected to battery its goes around in a circle, but not great.
What else do I need to change to make it walk ?
Is there any kind soul who would help a newbie. I thought this would be a good starter robot but am out of my depth already.
Many thanks