HTTP server is created by connecting an ENC28J60 module to the mbed board. It is serving a webpage which enables remotely turn on/off LED1 (or other device). Compile, download, run and type 192.168.0.170/secret/ into your web browser and Flot Interactivity Graphique
Dependencies: UIPEthernet mbed FCT_WEB hebergement
Fork of WebSwitch_ENC28J60 by
Page généré :
P.S : 1ère mise en fonctionnement de la carte NUCLEO STM32F411RET6 Instruction pour la mise en fonctionnement : https://developer.mbed.org/users/Fo170/notebook/the-stm32-nucleo-64-board/
Vue d'ensemble :
Vue de la carte ENC28J60 :
Carte Nucléo :
Diff: main.cpp
- Revision:
- 15:b241b1fccd1f
- Parent:
- 14:671fa04504c2
- Child:
- 16:c074bfec598f
--- a/main.cpp Wed Aug 19 11:05:49 2015 +0000 +++ b/main.cpp Wed Aug 19 16:12:10 2015 +0000 @@ -134,7 +134,7 @@ httpContent += "var color_Y = \"#FF0000\";\r\n"; httpContent += "var label_Y = \"Adc(x)\";\r\n"; //httpContent += "var x_min = -0.5, x_max = 14.5, y_min = -0.5, y_max = 1.5;\r\n"; - sprintf(buffer, "var x_min = %f, x_max = %f, y_min = %f, y_max = %f;\r\n", x_min, x_max, y_min, y_max); + sprintf(buffer, "var x_min = %.1f, x_max = %.1f, y_min = %.1f, y_max = %.1f;\r\n", x_min, x_max, y_min, y_max); httpContent += buffer; //httpContent += "var array_value = [[-0.1,0.1],[2,0.2],[3,0.3],[4,0.4],[5,0.5],[6,0.6],[7,0.7],[8,0.8],[9,0.9],[10,1],[11,1.01],[12,1.02],[13,1.03],[14,1.04]];\r\n"; if(Sample > NB_SAMPLES) @@ -142,7 +142,7 @@ httpContent += "var array_value = ["; for(i = 0 ; i < NB_SAMPLES ; i++) { - sprintf(buffer, "[%f,%f],", time_samples[i], adc_samples[i]); + sprintf(buffer, "[%.1f,%.1f],", time_samples[i], adc_samples[i]); httpContent += buffer; } httpContent += "];\r\n"; @@ -161,11 +161,15 @@ if(status == 1) { - httpContent += "<font color=#00FF00>Switch ON</font>\r\n"; + httpContent += "<font color=#00FF00>Switch ON</font> "; + httpContent += str_ampoule_ON; + httpContent += "\r\n"; } else { - httpContent += "<font color=#FF0000>Switch OFF</font>\r\n"; + httpContent += "<font color=#FF0000>Switch OFF</font> "; + httpContent += str_ampoule_OFF; + httpContent += "\r\n"; } httpContent += "<hr>\r\n"; @@ -173,11 +177,15 @@ httpContent += "(Contact repos) \r\n"; if(button_usr) { - httpContent += "<font color=#00FF00>BUTTON ON</font>\r\n"; + httpContent += "<font color=#00FF00>BUTTON ON</font> "; + httpContent += str_ampoule_ON; + httpContent += "\r\n"; } else { - httpContent += "<font color=#FF0000>BUTTON OFF</font>\r\n"; + httpContent += "<font color=#FF0000>BUTTON OFF</font> "; + httpContent += str_ampoule_OFF; + httpContent += "\r\n"; } httpContent += "<hr>\r\n"; @@ -190,13 +198,15 @@ // this converts the value in seconds obtained above to human readable format and assigns it to the timestamp sprintf(buffer, "%s", time_stamp);// diplays the human readable time */ - sprintf(buffer, "%.1f ", Seconds);// diplays the human readable Seconds + sprintf(buffer, "%.1f Seconds ", Seconds);// diplays the human readable Seconds httpContent += buffer; - httpContent += "Seconds\r\n<hr>\r\n"; + httpContent += str_chrono; + httpContent += "\r\n<hr>\r\n"; //---------------- httpContent += "AnalogIn(PC_5) : "; - sprintf(buffer, "%.0f mV\r\n", meas); + sprintf(buffer, "%.0f mV ", meas); httpContent += buffer; + httpContent += str_thermometre; httpContent += "<hr>\r\n<p>Usage Password Page :<p>http://host_or_ip/password<p><hr>\r\n"; httpContent += "<script language=\"javascript\" type=\"text/javascript\">WebServerNucleo_Interactivity();</script>\r\n"; httpContent += "</BODY></HTML>";