i am trying to write a subroutine for a line follower sensor called tracker 3.0 made by lynx motion. my problems is that i cant get it to go in a straight line if it goes to one side a little bit more then the other. i added a delay to avoid the blind spot but i can't make it go in straight line
this is the code so far
#include "sys/axon.h"
#include "a2d.h"
#include "servos.h"
// Define two motors
SERVO m2a = MAKE_SERVO(FALSE, E5,1499,453); //left side
SERVO m1a = MAKE_SERVO(TRUE, E4,1500,503); //right side
SERVO arm = MAKE_SERVO(TRUE, H4,1500,500); //gripper arm
// Create the list - remember to place an & at the start of each servo name
SERVO_LIST servos[] = {&m1a,&m2a,&arm};
// Create a driver for the list of servos
SERVO_DRIVER bank1 = MAKE_SERVO_DRIVER(servos);
// Global variable that indicates the current state
uint8_t state;
// Initialise the servos
void appInitHardware(void){
servoPWMInit(&bank1);
}
TICK_COUNT appInitSoftware(TICK_COUNT loopStart){
return 0;
}
TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart){
// A3 Left
// A4