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.
Diff: main.cpp
- Revision:
- 9:7b9094864268
- Parent:
- 8:5640c8c5088e
- Child:
- 11:d13596393d56
- Child:
- 13:ddff4bb7c24f
--- a/main.cpp Thu Oct 06 11:26:16 2022 +0000 +++ b/main.cpp Thu Oct 06 11:32:01 2022 +0000 @@ -14,7 +14,7 @@ // Prototypes int PitTest(void); // Test if to robot needs to goto pit - +void InitialMessages (void); // Prints initial message to the LCD int main() { m3pi.sensor_auto_calibrate(); @@ -29,29 +29,14 @@ float speed = MAX; /*Team 7 Variabels*/ - int gotoPit = 0; // wether or not the robot is heading to pit. Initialstate false. int ccount; //used to count cycles /*Printing secret cat mission*/ - m3pi.cls(); - - m3pi.locate(0,0); - m3pi.printf("eliminate"); - m3pi.locate(0,1); - m3pi.printf("all cats"); - wait(200.0); - - m3pi.cls(); - m3pi.locate(0,0); - m3pi.printf("%f.3 ",m3pi.battery()); - m3pi.locate(0,1); - m3pi.printf("%f.3 ",m3pi.pot_voltage()); - wait(200.0); - m3pi.cls(); - + InitialMessage(); + while (1) { @@ -99,7 +84,24 @@ } } - +void InitialMessage(void){ + /*Prints iniatl secret mission*/ + + m3pi.cls(); + m3pi.locate(0,0); + m3pi.printf("eliminate"); + m3pi.locate(0,1); + m3pi.printf("all cats"); + wait(200.0); + + m3pi.cls(); + m3pi.locate(0,0); + m3pi.printf("%f.3 ",m3pi.battery()); + m3pi.locate(0,1); + m3pi.printf("%f.3 ",m3pi.pot_voltage()); + wait(200.0); + m3pi.cls(); +} int PitTest(void){ /* Test the batteri voltage if the robot is not headed for pit */ @@ -112,8 +114,8 @@ /*Test if the voltage is below the treshold if so turn on go to pit mode*/ if (m3pi.battery() <= BATVOLTTRESHOLD ()){ - result = 1; // set goto pit condition - led1 = 1; // turn on Led 1 + result = 1; // Set goto pit condition + led1 = 1; // Turn on Led 1 m3pi.cls(); m3pi.locate(0,0); m3pi.printf("Going to");