#include <stdbool.h>
#include <stdio.h>
#include <unistd.h>
#include <MyroC.h>

int
main (void)
{
  const unsigned int duration = 1; /* Time (in seconds) to display a picture */
  const char * name = "Robo View";

  Picture pic; /* Structure buffer for storing picture captured by the fluke */
  
  rConnect ("/dev/rfcomm0");
  
  pic = rTakePicture();  /* Take first picture */

  rMotors (-0.01, 0.01); /* "Pan" by rotating clockwise */

  while (true)
    {
      rDisplayPicture (&pic, -4*(float)duration, name); /* Display new picture */
      pic = rTakePicture(); /* Take a new picture while old one is displaying */
      rBeep (0.125, 880); /* Beep to indicate a continuation */
      rBeep (0.125, 1319);
    }
  rDisconnect(); /* Stop and disconnect (unreachable statement) */
  return 0;
}
