// Lidar Example, T. Braunl 2018
#include "eyebot.h"

int main ()
{ int i, scan[360];

  while (1)
  { LCDMenu("SCAN", "", "", "END");
    if (KEYGet() == KEY4) return 0;
    LCDClear();
    LIDARGet(scan);
    for (i=0; i<360; i++)
      LCDLine(i,250-scan[i]/10, i,250, BLUE);
    LCDLine(180,0, 180,250, RED);   // straight (0°)
    LCDLine( 90,0,  90,250, GREEN); // left  (-90°)
    LCDLine(270,0, 270,250, GREEN); // right (+90°)
    LCDSetPrintf(19,0, "            -90             0             +90");
  }
}
