First test programme for the RenBuggy
Dependencies: SevenSegmentDisplay mbed
Fork of Renbed_Buggy_Basics by
main.cpp@0:23373ebd6d3a, 2016-04-21 (annotated)
- Committer:
- MiskinPrj
- Date:
- Thu Apr 21 08:59:08 2016 +0000
- Revision:
- 0:23373ebd6d3a
- Child:
- 3:152595d33544
First save and publish
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MiskinPrj | 0:23373ebd6d3a | 1 | /********************************************************* |
MiskinPrj | 0:23373ebd6d3a | 2 | *Ren_Buggy_Basics * |
MiskinPrj | 0:23373ebd6d3a | 3 | *Author: Elijah Orr & Dan Argust * |
MiskinPrj | 0:23373ebd6d3a | 4 | * * |
MiskinPrj | 0:23373ebd6d3a | 5 | *This program demonstates use of a library of functions * |
MiskinPrj | 0:23373ebd6d3a | 6 | *(buggy_functions) to control the movement of the * |
MiskinPrj | 0:23373ebd6d3a | 7 | *RenBuggy. * |
MiskinPrj | 0:23373ebd6d3a | 8 | *********************************************************/ |
MiskinPrj | 0:23373ebd6d3a | 9 | |
MiskinPrj | 0:23373ebd6d3a | 10 | #include "mbed.h" //"mbed.h" is a library that makes it easier to program microcontrollers |
MiskinPrj | 0:23373ebd6d3a | 11 | |
MiskinPrj | 0:23373ebd6d3a | 12 | #include "buggy_functions.h" //"buggy_functions.h" contains the functions that we will use to move the buggy |
MiskinPrj | 0:23373ebd6d3a | 13 | |
MiskinPrj | 0:23373ebd6d3a | 14 | /* The basic functions available are: |
MiskinPrj | 0:23373ebd6d3a | 15 | * |
MiskinPrj | 0:23373ebd6d3a | 16 | * forward(time); |
MiskinPrj | 0:23373ebd6d3a | 17 | * left(time); |
MiskinPrj | 0:23373ebd6d3a | 18 | * right(time); |
MiskinPrj | 0:23373ebd6d3a | 19 | * hold(time); |
MiskinPrj | 0:23373ebd6d3a | 20 | * |
MiskinPrj | 0:23373ebd6d3a | 21 | * see buggy_functions.h for a full list. |
MiskinPrj | 0:23373ebd6d3a | 22 | */ |
MiskinPrj | 0:23373ebd6d3a | 23 | |
MiskinPrj | 0:23373ebd6d3a | 24 | |
MiskinPrj | 0:23373ebd6d3a | 25 | int main() //int main is run automatically. Place your program here |
MiskinPrj | 0:23373ebd6d3a | 26 | { |
MiskinPrj | 0:23373ebd6d3a | 27 | forward(5.5); //move the buggy forward for 5.5 seconds |
MiskinPrj | 0:23373ebd6d3a | 28 | hold(5); //wait for 16 seconds |
MiskinPrj | 0:23373ebd6d3a | 29 | |
MiskinPrj | 0:23373ebd6d3a | 30 | } |