/* **********************************************
| Omnidirectional Drive - Mecanum Wheels
| Example for using MOTOR and QUAD functions for
| driving a vehicle with OMNI_DRIVE steering
|
| Thomas Braunl, 2004, 2005, 2017
| ---------------------------------------------- */ 
#include "eyebot.h"
#define  S 50  // Speed

void Mdrive(char* txt, int Fleft, int Fright, int Bleft, int Bright)
/* Print txt and drive motors and encoders for 1.5s */
{ LCDPrintf("%s\n", txt);
  MOTORDrive(1, Fleft);
  MOTORDrive(2, Fright);
  MOTORDrive(3, Bleft);
  MOTORDrive(4, Bright);
  LCDPrintf("Enc.%5d %5d\n    %5d %5d\n",
    ENCODERRead(1), ENCODERRead(2), ENCODERRead(3), ENCODERRead(4));
}


int main ()
{ LCDPrintf("Mecanum Wheels\n");

  Mdrive("Forward",     S, S, S, S);
  OSWait(6000);
  Mdrive("Left",       -S, S, S,-S);
  OSWait(2000);
  Mdrive("Stop",        0, 0, 0, 0);
  
  return 0;
}

