Ehhh T NUL
Dependencies: mbed bloc_io mbed-rtos html
Diff: main.cpp
- Revision:
- 6:c785bc12d542
- Parent:
- 5:e3b59050984c
--- a/main.cpp Tue Dec 17 09:04:10 2019 +0000 +++ b/main.cpp Tue Dec 17 09:58:30 2019 +0000 @@ -17,6 +17,7 @@ // analog input connected to mbed // valid pmw mbed pin Serial pc(USBTX, USBRX); // tx, rx + // Top_Hall Pin float pi=3.14159265359; int valref=0 ;//rajout @@ -30,6 +31,8 @@ int frein; int overcurrent; float gaz; +float temp; +float courrant; //void modulo (int ); @@ -213,6 +216,7 @@ pc.printf(" veuillez saisir un choix parmi la liste proposee: \r\n"); pc.printf(" a:saisie consigne pwm \r\n"); pc.printf(" c:lecture interne \r\n"); + pc.printf(" d:%analogique \r\n"); pc.printf(" b:calibration \r\n"); pc.printf(" v:vitesse\r\n"); pc.printf(" m:mode \r\n"); @@ -253,8 +257,12 @@ getchar(); max=poignee.read(); printf("max%f\n\r",max); - break; + + case 'd' : + Jack(); + break; + case 'm': do { printf("choisissez un mode :0 pour automatique et 1 pour manuel"); @@ -437,3 +445,14 @@ kpar=kpar+lire; ktot=ktot+lire; } + +void Jack () +{ + valGaz=((Vgaz-min)*100)/(max-min); + x=Vbat.read(); + pc.printf("%g",x); + valBat=(100*x); //20=val max batterie + Temp; + Courrant; + pc.printf("Poigne : %g \t Batterie : %g \n\r",valGaz,valBat); +} \ No newline at end of file