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

#define NUM_PICTURES 3

int
main()
{
   rConnect("/dev/rfcomm0");

   /* This is an array of pictures. Picture is a type just like char and int, but
      it is for storing Scribbler pictures. */
  Picture pics[NUM_PICTURES];

  const char *name = "Here is your current picture!";
  double duration = 10.0;

  for (int i = 0; i < NUM_PICTURES ; i++)
    {
      pics[i] = rTakePicture();
      rTurnRight (.5, 1);

      /* printf ("This is a blocking call.\n");
         printf ("This means that the new picture cannot be taken \n");
         printf ("until the duration time expires. \n");
         rDisplayPicture (pics[i], duration, name); 
       */
	
      /* printf("This is a non-blocking call.\n");
         printf ("This means that the new picture is taken \n");
         printf ("even if the window for the old picture remains open. \n");
         printf ("The windows will just pop on top of one another.\n");
         printf ("Relax, and enjoy the photos!\n");
         rDisplayPicture (pics[i], -1.0 * duration, name); 
       */

      rBeep(1, 440); /* Beep to indicate a continuation */
    }

  rDisconnect();
  return 0;
}
