Beginners: please read this post and this post before posting to the forum.
0 Members and 1 Guest are viewing this topic.
#define UART0_RX_BUFFER_SIZE 40#include "hardware.h"#include <Gait/GaitDesigner.h>#include <servos.h>#include <rprintf.h> SERVO servo1 = MAKE_SERVO(false,B0,1500,650);SERVO servo2 = MAKE_SERVO(false,B1,1500,650);SERVO servo3 = MAKE_SERVO(false,B2,1500,650);static SERVO_LIST PROGMEM bank1_list[] = {&servo1,&servo2,&servo3};SERVO_DRIVER bank1 = MAKE_SERVO_DRIVER(bank1_list); ACTUATOR_LIST PROGMEM all[] = {&servo1.actuator,&servo2.actuator,&servo3.actuator };GAIT_DESIGNER gait = MAKE_GAIT_DESIGNER(all, UART0, (BAUD_RATE)115200);void appInitHardware(void){ servoPWMInit(&bank1); gaitDesignerInit(&gait); rprintfInit(&myUartSendByte);}// Initialise the softwareTICK_COUNT appInitSoftware(TICK_COUNT loopStart){ return 0;}TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart){ gaitDesignerProcess(&gait); //rprintf("hello "); //to test loop is working return 0;}
#include "hardware.h"#include <Gait/GaitDesigner.h>// The gait designer however expects a single list of all the servos to be controlledACTUATOR_LIST PROGMEM all[] = {&_servo1_.actuator,&_servo2_.actuator,&_servo3_.actuator };// create an object that is used to talk to the Gait Designer program on the computer// specifying the list of all the servos and the uart and baud rateGAIT_DESIGNER gait = MAKE_GAIT_DESIGNER(all, UART0, (BAUD_RATE)115200);// Initialise the hardwarevoid appInitHardware(void) { gaitDesignerInit(&gait); //Start Gait Designer initHardware();}// Initialise the softwareTICK_COUNT appInitSoftware(TICK_COUNT loopStart){ return 0;}// This is the main loopTICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart) { gaitDesignerProcess(&gait); return 0;}
#include "hardware.h"#include "sweep.h" //exported file from gait designer, is read only and have not modified#include <Gait/GaitRunner.h>ACTUATOR_LIST PROGMEM all[] = {&_servo1_.actuator,&_servo2_.actuator,&_servo3_.actuator,&_servo4_.actuator,&_servo5_.actuator,&_servo6_.actuator,&_servo7_.actuator };//The first parameter is the ACTUATOR_LIST containing all of the servos you want to control.//The second parameter is the list of possible animations in the gait file exported from Gait Designer. This is called 'animations' - unless you have modified the file by hand.G8_RUNNER gait = MAKE_G8_RUNNER(all, animations);void appInitHardware(void) { gaitRunnerInit(&gait); initHardware();}TICK_COUNT appInitSoftware(TICK_COUNT loopStart){ //gaitRunnerPlay(G8_RUNNER* runner, uint8_t animation, int16_t loopSpeed, DRIVE_SPEED speed, int16_t repeatCount gaitRunnerPlay(&gait, 0, 1000, 100, 10); return 0;}TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart) { gaitRunnerProcess(&gait); return 0;}
const PROGMEM G8_ANIMATION PROGMEM animations[1] = {