/* **********************************************
| Ackermann Drive
| Example for using MOTOR and QUAD functions for
| driving a vehicle with ACKERMANN_DRIVE steering
|
| Thomas Braunl, 2004, 2017
| -----------------------------------------------*/ 
#include "eyebot.h"

void Mdrive(char* txt, int drive, int steer)
/* Print txt and drive motors and encoders for 1.5s */
{ LCDPrintf("%s\n", txt);
  MOTORDrive(1, drive);
  SERVOSet  (1, steer);
}

 
int main ()
{ LCDPrintf("Ackermann Steering\n");
  Mdrive("Forward",     60, 128);  OSWait(4000);
  Mdrive("Backward",   -60, 128);  OSWait(4000);
  Mdrive("Left Curve",  60,   0);  OSWait(2000);
  Mdrive("Right Curve", 60, 255);  OSWait(2000);
  Mdrive("Stop",         0,  0);
  return 0;
}

