/* Use a struct to store a move by the Scribbler 2 robot */

#include <MyroC.h>

typedef struct 
{
  double speed;
  double time;
} movement_t;

int
main()
{
  rConnect("/dev/rfcomm0");
  rSetForwardnessTxt("fluke-forward");

  /* Declare information for one robot movement */
  movement_t action;

  /* Initialize the elements of a robot movement */
  action.speed = 0.8;
  action.time = 2.0;

  /* Command to move forward according to the speed and time stored
     in the struct */
  rForward( action.speed, action.time);

  /* beep after movement */
  rBeep(1, 600);

  rDisconnect();
  return 0;
} // main
