This is my code but when i connect The gait designer to the device with this code, the servos do not even move, they are also not being held when i turn them, I am connecting with a usb to UART device.
i am going to update webbotlib and retry but any help would be very useful
//#define UART_TX_BUFFER_SIZE 20 //These are defined to reduce the delay
#define UART_RX_BUFFER_SIZE 40 //and data loss in the send and recieve buffers
#include "sys/atmega328P.h" //These are the includes required by the webbotlib library.
#include "a2d.h"
#include "servos.h"
#include "uart.h"
#include "Gait/GaitDesigner.h"
#include "pwm.h"
#include "rprintf.h"
//#define sensorLR ADC_NUMBER_TO_CHANNEL(7)
//#define sensorUD ADC_NUMBER_TO_CHANNEL(6)
SERVO Hip = MAKE_SERVO(TRUE, B1, 1500, 925); //These 4 lines define 2 servos and initialise them
//SERVO Azi = MAKE_SERVO(TRUE, B1, 1500, 925); //they can then be called later on in the code in a very simple way
//SERVO Leg = MAKE_SERVO(TRUE, B2, 1500, 925);
SERVO_LIST servos[] = {&Hip};//, &Azi, &Leg};
SERVO_DRIVER bank1 = MAKE_SERVO_DRIVER(servos);
ACTUATOR_LIST all[] = {&Hip.actuator};//,&Azi.actuator,&Leg.actuator};
GAIT_DESIGNER gait = MAKE_GAIT_DESIGNER(all, UART0, (BAUD_RATE)115200);
void appInitHardware(void) // In my initialising code
{
servoPWMInit(&bank1); //This starts the servos moving
gaitDesignerInit(&gait);
rprintfInit(&uart0SendByte);
}
TICK_COUNT appInitSoftware(TICK_COUNT loopStart)//This is the main loop that provides timing by delaying by 1 cycle
{
return 0;
}
// This is the main loop, it contains the latest stable release of the
TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart)
{
gaitDesignerProcess(&gait);
return 100;
}
Edit: Fixed
, just shows that you should always get the latest version...