// EyeBot Demo Program: Camera Interactive, T. Bräunl, Nov 2015
#include "eyebot.h"

int main()
{ BYTE img[QVGA_SIZE];
  int size = 0, gray = 1;
  
  LCDMenu("SIZE", "COL/GRAY", "", "END");
  CAMInit(QQVGA);  // automatically sets LCDIMageSize and IPSize

  while (1)
  { switch(KEYRead())
    { case KEY1: size = !size;
                 if (size) CAMInit(QVGA);
                 else { CAMInit(QQVGA);
                        LCDClear();
                        LCDMenu("SIZE", "COL/GRAY", "", "END");
                      }
                 break;
     case KEY2:  gray = !gray;
                 break;
     case KEY4:  return 0;
    }

    if (gray)
    { CAMGetGray(img);
      LCDImageGray(img);
    }
    else  // color
    { CAMGet(img);
      LCDImage(img);
    }
  }
  return 0;
}
