/* ------------------------------------------------------
| Filename:     etch.c
| Authors:      Thomas Braunl
| Description:  pixel operations resembl. "etch a sketch"
| ----------------------------------------------------- */
#include <eyebot.h>
#define X 320
#define Y 240	

int main()
{ int k;
  int x=0, y=0, sign=1;

  LCDMenu("X","Y","+/-","END");
  while(KEY4 != (k=KEYRead()))
  { LCDPixel(x,y, WHITE);
    switch (k)
    { case KEY1: x = (x + sign + X) % X; break;
      case KEY2: y = (y + sign + Y) % Y; break;
      case KEY3: sign = -sign; break;
    }
    LCDSetPrintf(18,0, "%3d:%3d  (x,y)", x,y);
  }
  return 0;
}
