// EyeBot Demo Program: Camera Continuous Display, T. Braunl, May 2016
#include "eyebot.h"
#define mid (118*320 +159) // mid point of image

int main()
{ BYTE img[QVGA_SIZE], x;

  LCDMenu("", "", "", "END");
  CAMInit(QVGA);
  do
  { CAMGetGray(img);
//    x = img[mid] & 0xff                          # make unsigned
    x = img[mid];
    LCDSetPrintf(19,0, "image mid point: %3d ", x);
    img[mid]=255; img[mid-1]=255; img[mid+1]=255; // mark pont as white cross
    img[mid-320]=255; img[mid+320]=255;
    LCDImageGray(img);
  } while (KEYRead() != KEY4);
  return 0;
}