Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 /********************************************************* 00002 *RenBuggyTimed * 00003 *Author: Elijah Orr * 00004 * * 00005 *This program demonstates use of a library of functions * 00006 *(TimedMovement) to control the movement of the RenBuggy.* 00007 * * 00008 *********************************************************/ 00009 00010 /* mbed is a library made by mbed.org that contains 00011 classes/functions designed to make programming mbed 00012 microcontrollers easier */ 00013 #include "mbed.h" 00014 /* #include tells the compiler to include TimedMovement.h 00015 and TimedMovement.cpp in the program */ 00016 #include "TimedMovement.h" 00017 00018 /* the main function is where a program will begin to execute. */ 00019 00020 /**************************************************************** 00021 * Function: main() * 00022 * * 00023 * Controls the movement of the RenBuggy by varying the speed * 00024 * of each motor * 00025 * * 00026 * Inputs: none * 00027 * * 00028 * Returns: none * 00029 ****************************************************************/ 00030 int main() 00031 { 00032 /* here we can call the functions defined in TimedMovement.h 00033 and TimedMovement.cpp, and specify the length of time we want 00034 them to run for by passing a variable which represents a 00035 length of time in seconds */ 00036 forward(5); 00037 left(3); 00038 forward(2); 00039 wait(3); 00040 right(3); 00041 forward(6); 00042 }
Generated on Sat Jul 16 2022 20:54:35 by
1.7.2