Gestione Timer per roboval

Dependencies:   TextLCD mbed

Timer di misura per roboval. Il programma è stato scritto per la scheda Nucleo STM32F401RE, prevede la misura del tempo totale e dei parziali sui tre giri

Files at this revision

API Documentation at this revision

Comitter:
fdalforno
Date:
Fri Apr 22 07:25:05 2016 +0000
Parent:
1:289167b04f0d
Commit message:

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Apr 22 07:21:35 2016 +0000
+++ b/main.cpp	Fri Apr 22 07:25:05 2016 +0000
@@ -4,7 +4,7 @@
 #include "TextLCD.h"
 
 #define NUM_LAP 3
-#define VBAT_MIN 7
+#define VBAT_MIN 7.2
 
 typedef struct time_screen {
    int cents;
@@ -86,7 +86,7 @@
     proximity.rise(&measure_time);    
     user_button.fall(&reset_measure);
     
-    //Controllo batteria
+  
    
     
     while(true) {
@@ -111,7 +111,8 @@
             wait(0.1);
         }else{
             if(lap == 0){
-                double battery =  ((3.3 * vbat) * 57) / 10;
+                //Controllo batteria con partitore resistivo
+                double battery =  ((3.3L * vbat) * 57) / 10;
                 if(battery < VBAT_MIN){
                     lcd.locate(0,1);
                     lcd.printf("LOW BAT %2.1f",battery);