11 #include "simpletools.h" 23 int DO = 22, CLK = 23;
25 sd_mount(DO, CLK, DI,
CS);
26 fp = fopen(
"navset.txt",
"r");
28 fread(str, 1, 512, fp);
29 int strLength = strlen(str);
37 while(!isalpha(str[i])) i++;
38 sscan(&str[i],
"%s", cmdbuf);
40 if(!strcmp(cmdbuf,
"end"))
break;
43 while(!isdigit(str[i])) i++;
44 sscan(&str[i],
"%s", valbuf);
49 if(strcmp(cmdbuf,
"forward") == 0)
51 else if(strcmp(cmdbuf,
"backward") == 0)
53 else if(strcmp(cmdbuf,
"left") == 0)
55 else if(strcmp(cmdbuf,
"right") == 0)
This library takes care of encoder monitoring and servo signalling, and provides a simple set of func...
void drive_goto(int distLeft, int distRight)
Make each wheel go a particular distance. Recommended for straight forward, backward, turns and pivots. Not recommended for curves. This function ramps up to full speed if the distance is long enough. It holds that speed until it needs to ramp down. After ramping down it applies compensation. This function is primarily a convenience for dead reckoning, and does not return until the maneuver has completed.
const PropWare::Port::Mask CS
void drive_speed(int left, int right)
Set wheel speeds in encoder ticks per second. An encoder tick is 1/64th of a revolution, and makes causes the wheel to roll 3.25 mm.