A program that allows control of the RenBuggy by altering the relative speeds of the wheels.
main.cpp
- Committer:
- RenBuggy
- Date:
- 2016-04-04
- Revision:
- 3:c12fbf373785
- Parent:
- 2:949a87c7042f
File content as of revision 3:c12fbf373785:
/********************************************************* *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); }