A program that allows control of the RenBuggy by altering the relative speeds of the wheels.

Dependencies:   mbed-renbed

main.cpp

Committer:
RenBuggy
Date:
2016-04-13
Revision:
6:ce9b3fbdd856
Parent:
3:c12fbf373785

File content as of revision 6:ce9b3fbdd856:

/*********************************************************
*RenBuggyTimed                                           *
*Author: Elijah Orr                                      *
*                                                        *  
*This program demonstates use of a library of functions  *
*(TimedMovement) to control the movement of the RenBuggy.*
*                                                        *
*********************************************************/

/* mbed is a library made by mbed.org that contains 
classes/functions designed to make programming mbed 
microcontrollers easier */
#include "mbed.h"
/* #include tells the compiler to include TimedMovement.h
and TimedMovement.cpp in the program */
#include "TimedMovement.h" 

/* the main function is where a program will begin to execute. */

/****************************************************************
* Function: main()                                              *
*                                                               *
* Controls the movement of the RenBuggy by varying the speed    *
* of each motor                                                 *
*                                                               *
* Inputs: none                                                  *
*                                                               *
* Returns: none                                                 *
****************************************************************/
int main()
{
    /* here we can call the functions defined in TimedMovement.h
    and TimedMovement.cpp, and specify the length of time we want
    them to run for by passing a variable which represents a 
    length of time in seconds */
    forward(5);
    left(3);
    forward(2);
    wait(3);
    right(3);
    forward(6);
}