/* *********************************** */
/* Testing servo-mounted camera        */
/* Thomas Braunl, Jan. 2005            */
/* *********************************** */
#include "eyebot.h"

void checkpos(int pan, int tilt)
{ BYTE img[QVGA_SIZE];

  SERVOSet(1, pan);
  SERVOSet(2, tilt);
  LCDSetPrintf(0,0,"PanTlt: %3d %3d\n", pan, tilt);
  CAMGet(img);
  LCDImage(img);
}


int main()
{ int pos;

  CAMInit(QVGA);

  for (pos=128; pos<251; pos+=4) checkpos(pos, 128);  // right
  for (pos=255; pos>131; pos-=4) checkpos(pos, 128);

  for (pos=128; pos<251; pos+=4) checkpos(128, pos);  // down
  for (pos=255; pos>131; pos-=4) checkpos(128, pos);

  for (pos=128; pos>3;   pos-=4) checkpos(pos, 128);  // left
  for (pos=0;   pos<125; pos+=4) checkpos(pos, 128);

  for (pos=128; pos>3;   pos-=4) checkpos(128, pos);  // up
  for (pos=0;   pos<125; pos+=4) checkpos(128, pos);

  return 0;
}

