/*
| ------------------------------------------
| Filename: upload_eye2.c
|
| Author:   Thomas Braunl, Aug. 2003
|
| Description: 
| serial data upload: EyeBot --> PC 
| use libc functions
| -----------------------------------------
*/
#include "eyebot.h"
#include "stdio.h"

int main ()
{ FILE *ser;
  char key;

  LCDPrintf("UPLOAD DATA\n");
  LCDMenu("ABC","012"," ","END");
  OSInitRS232(SER115200, NONE, SERIAL1);
  ser = fdopen(SERIAL1, "w");
  if (ser==NULL) {LCDPrintf("serial init error\n"); }
   else LCDPrintf("init OK >%d<\n", (int) ser);

  do
  { key = KEYGet();
    switch (key)
    { case KEY1: 
      LCDPrintf("ABCDEFG\n");
      fprintf(ser,"ABCDEFG\n");
      break;

      case KEY2:
      LCDPrintf("0123456789\n");
      fprintf(ser,"0123456789\n");
      break;
    }
  } while (key != KEY4);

  fclose(ser);
  return 0;
}


