#include "pai.h"

void TrainColor(int channel) {
  sfMessage("Commencing color training...\nPlease place color in the center of camera's field of view\n");
  sfPause(7000);
  paiTrainVisChannel(channel);
  sfMessage("Color acquired.");
  paiSing("FFGAAFGE");
}

int main(void) {
  int x, y;
  int cycles;
  int rvel = 100;
  int i = 0;
  sfStartup(1);			/* start up the Saphira window, and then keep going */
  sfMessage("Connect to robot to train on color.");

  while (!sfIsConnected) sfPause(100); /* wait until we're connected */

  sfMessage("Waiting a little...");
  sfPause(2000);		/* wait for connection to settle */
  sfSetDisplayState(sfGLOBAL, TRUE);	/* use the global view */
  TrainColor(CHANNEL_A);
  sfMessage("Training complete.  Remove target from field of view.");
  sfDisconnectFromRobot();	/* we're gone... */
}
