7 #include "simpletools.h" 10 int lightLeft, lightRight, ndiff;
11 int speedLeft, speedRight;
19 lightLeft = rc_time(9, 1);
23 lightRight = rc_time(5, 1);
25 ndiff = 200 * lightRight / (lightRight + lightLeft) - 100;
29 if(ndiff >= 0) speedLeft -= (ndiff * 4);
30 else speedRight += (ndiff * 4);
This library takes care of encoder monitoring and servo signalling, and provides a simple set of func...
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.