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

#define NUM_PICTURES 3

int
main (void)
{
   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];

  /* Declare a string as a mutable character array so we can update the title */
  char window_name[9] = "Window A"; 
  
  double display_duration = 10.0;

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

    
    /* printf ("This is a blocking call.\n"
             "This means that the new picture cannot be taken \n"
             "until the duration time expires. \n");
       rDisplayPicture (&pics[i], display_duration, window_name); 
    */
    
    
    /* printf ("This is a non-blocking call.\n"
             "This means that the new picture is taken \n"
             "even if the window for the old picture remains open. \n"
             "The windows will just pop on top of one another.\n"
             "Relax, and enjoy the photos!\n");
       rDisplayPicture (&pics[i], -1.0 * display_duration, window_name); 
    */
       
       /* Change the window name (A, B, C, etc.) so a new window opens */
       window_name[7]++;
       
    rBeep (1, 440); /* Beep to indicate a continuation */
  } // for
  
  rDisconnect();
  return 0;
} // main
