/******* * square-move-1.c * * Program uses a struct to store a move by the Scribbler 2 robot * * Author: Henry M. Walker * Date: 15 March 2012 * Revised: 18 October 2016 * * Motivated by an example by April O'Neill and Erik Opavsky * Date: 4 August 2011 *******/ #include "MyroC.h" struct movement{ double speed; double time; }; int main() { rConnect ("/dev/rfcomm0"); /* Declare and initialize data for one robot movement */ struct movement action = {0.8, 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