scooter correction for mbed_os V5.2
Dependencies: bloc_io html_mbed_os
Fork of scooter_mbed by
Diff: main.cpp
- Revision:
- 3:ac3990c4a479
- Parent:
- 1:e3cb81b3cbea
diff -r adf86715e39b -r ac3990c4a479 main.cpp --- a/main.cpp Wed Aug 12 15:58:15 2015 +0000 +++ b/main.cpp Sat Nov 26 16:08:37 2016 +0000 @@ -12,6 +12,7 @@ #define DELTA_T 0.1F // speed measurement counting period Ticker IT_Timer_Gaz,IT_Speed; +int gCPT=0; float fSpeed=0; float fTabVal[10];// need to store analog value float fGaz,fTemp,fBat,fIdc; @@ -186,7 +187,7 @@ /********* main cgi function used to patch data to the web server thread **********************************/ void CGI_Function(void) // cgi function that patch web data to empty web page { char ma_chaine4[20]={};// needed to form html response - sprintf (ma_chaine4,"%d",(int)fSpeed);// convert speed as ascii string + sprintf (ma_chaine4,"%d",(int)gCPT++);// convert speed as ascii string Html_Patch (tab_balise,0,ma_chaine4);// patch first label with dyn.string sprintf (ma_chaine4,"%d",(int)(fGaz_Brute*100)/255);// convert count as ascii string @@ -258,7 +259,7 @@ //ma_chaine3 = Gen_HtmlCode_From_File("/local/pagecgi2.htm",tab_balise,5);// read and localise ^VARDEF[X] tag -Gen_HtmlCode_From_File("/local/pagecgi2.htm",tab_balise,5);// read and localise ^VARDEF[X] tag in empty html file +Gen_HtmlCode_From_File("/local/compteur.htm",tab_balise,2);// read and localise ^VARDEF[X] tag in empty html file IT_Timer_Gaz.attach_us(&MyITGaz, 10000);// install timer it each 10ms IT_Speed.attach_us(&MyITSpeed, 100000);// install timer it each 10ms @@ -275,13 +276,13 @@ while(cChoix!='q' and cChoix!='Q') -{pc.printf(" veuillez saisir un choix parmi la liste proposee: \n"); +{/*pc.printf(" veuillez saisir un choix parmi la liste proposee: \n"); pc.printf(" a:saisie consigne pwm \n"); pc.printf(" b:lecture registre PLD \n"); pc.printf(" c:lecture ADC 4 voies \n"); pc.printf(" d:calibration poignee Gaz \n"); pc.printf(" e:affichage vitesse \n"); - pc.printf(" q:quitter \n"); + pc.printf(" q:quitter \n");*/ /************* multithreading : main thread need to sleep in order to allow web response */ while (pc.readable()==0) // determine if char availabler {Thread::wait(10);} // wait 10 until char available on serial input