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:
- 54:c4f02c75ba8d
- Parent:
- 50:e7b27b75ddd9
- Parent:
- 53:cef682f8684b
- Child:
- 55:2fb2ec1cab2a
--- a/main.cpp Wed Oct 12 07:56:24 2022 +0000 +++ b/main.cpp Wed Oct 12 09:28:43 2022 +0000 @@ -26,12 +26,14 @@ #define VOLTAGELOGPATH "/local/voltage.txt" // Prototypes -int PitTest(void); // Test if to robot needs to goto pit -void InitialMessages(void); // Prints initial message to the LCD + + void LED_Control(int ledNumber, int state); //Turn ledNumber to 1=on, 0 = off void LED_Blink(int ledNumber); // Make ledNumber blinik -void LCDCountDown(int num); //LCD Coundown function +void LCD_CountDown(int num); //LCD Coundown function +void LCD_InitialMessages(void); // Prints initial message to the LCD +int PS_BatteryTest(void); // Test if to robot needs to goto pit void PS_PitStop(void); // void PS_CreateLog(void); // create a log file or resets it (WIP void PS_AddStopToLog(void); // Add one to the log @@ -57,7 +59,7 @@ int ccount = 0; //used to count cycles /*Printing secret cat mission*/ - InitialMessages(); + LCD_InitialMessages(); m3pi.sensor_auto_calibrate(); /*Create pitlog used to log the number of pitstop */ @@ -69,7 +71,7 @@ if (ccount % CYCLEBEFORETEST == 0 && gotoPit == 0) { TE_LogVoltage(ccount); - gotoPit = PitTest(); + gotoPit = PS_BatteryTest(); } if (gotoPit == 1) { @@ -120,7 +122,7 @@ } -void InitialMessages(void){ +void LCD_InitialMessages(void){ /*Prints iniatl secret mission*/ m3pi.cls(); @@ -142,13 +144,14 @@ m3pi.locate(0,1); m3pi.printf("TRACK!!"); wait(4.0); - LCDCountDown(3); + LCD_CountDown(3); m3pi.cls(); m3pi.locate(0,0); m3pi.printf("** GO **"); + wait (1.0); } -void LCDCountDown(int num){ +void LCD_CountDown(int num){ for (int i=0; i<num; i++) { m3pi.cls(); @@ -159,10 +162,10 @@ } -int PitTest(void){ +int PS_BatteryTest(void){ /* Test the batteri voltage if the robot is not headed for pit */ - const float BATVOLTTRESHOLD = 0.05; // Treshold i volt + const float BATVOLTTRESHOLD = 0.5; // Treshold i volt int result = 0; /*Test if the voltage is below the threshold if so turn on go to pit mode*/ @@ -299,4 +302,20 @@ fprintf(fptr," %8d %4.4f %4.4f \n" ,count, m3pi.battery(),m3pi.pot_voltage() ); fclose(fptr); -} \ No newline at end of file +<<<<<<< working copy +}||||||| base +} + +// Julesnaps smager godt og Andreas skal drikke hvergang en anden drikker + +// Det bliver hårdt :) +// Ingen sang - tak. + + + + +gnjask lfdajklf hasj klhdfjkl asdf +asd fasdf sda +a sdfa sdf daf da======= +} +>>>>>>> merge rev