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.
Dependencies: C12832 LM75B WifiEsp8266 Acquisitionentreesp2 AffichageSp1
main.cpp
00001 // acquerir la temperature avec le LM75B 00002 #include "mbed.h" 00003 #include "platform/mbed_thread.h" 00004 #include "LM75B.h" 00005 #include "acquisition.h" 00006 #include "affichagesp1.h" 00007 #include "wifiesp8266.h" 00008 00009 float VitFluxAir = 0; 00010 float ConsigneFluxAir = 0; 00011 float Freqhelice = 0; 00012 float Temperature = 0; 00013 float humidite = 0; 00014 00015 RawSerial PC(USBTX, USBRX); 00016 WifiEsp8266 Wifi(PA_11,PA_12); // WifiEsp8266(PinName Txd, PinName Rxd,float _timeout); 00017 DigitalOut En(PC_11); 00018 Ticker test1; 00019 bool Drticker1 = false; 00020 void event1() 00021 { 00022 Drticker1 = true; 00023 } 00024 00025 int main() 00026 { 00027 En.write(1); 00028 char WifiPhrase[maxdata]; 00029 bool ecranchange=false; 00030 AnalogIn Pot1(A0); 00031 AnalogIn Pot2(A1); 00032 LM75B sensor(D14,D15); 00033 AffichageEcransp1(); 00034 PC.baud(921600); 00035 PC.printf("Hello je suis SP1\r\n"); 00036 test1.attach(&event1,1); 00037 while (true) { 00038 if (Wifi.dataready()) { 00039 strcpy(WifiPhrase,Wifi.read()); 00040 switch (WifiPhrase[1]) { 00041 case 'F': 00042 ConsigneFluxAir=ConsigneFluxAir+1; 00043 Wifi.printf("$B%0.0f\r\n",ConsigneFluxAir); 00044 ecranchange=true; 00045 break; 00046 case 'G' : 00047 ConsigneFluxAir=ConsigneFluxAir-1; 00048 Wifi.printf("$B%0.0f\r\n",ConsigneFluxAir); 00049 ecranchange=true; 00050 break; 00051 default : ; 00052 } 00053 } 00054 if (Drticker1) { 00055 Drticker1 = false; 00056 Temperature = sensor.read(); 00057 humidite =Pot2.read() *92; 00058 VitFluxAir = Pot1.read()*72; 00059 Wifi.printf("$Z,%0.0f,%0.0f,%0.0f\r\n",VitFluxAir,Temperature,humidite); 00060 ecranchange=true; 00061 } 00062 if (ecranchange) { 00063 AffichageEcransp1(); 00064 ecranchange=false; 00065 } 00066 } 00067 } 00068 00069
Generated on Tue Aug 16 2022 17:32:48 by
