AirQualityClick on A0 on Nucleo-F411RE
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 #include "Air.h" 00003 00004 Serial pc(SERIAL_TX, SERIAL_RX); 00005 00006 //AnalogIn atm (A0); 00007 00008 Air atm (A0); 00009 00010 float atmos; 00011 int temp = 20, hum = 40; 00012 00013 00014 int main() { 00015 pc.printf("Debut programme \n\r"); 00016 pc.printf("Temperature = 20 C, Humidite = 40%% \n\r"); 00017 00018 while(1) { 00019 //atmos = atm.read(); 00020 atmos = atm.getPPM (); 00021 pc.printf("PPM : %.2f \n\r", atmos); 00022 00023 atmos = atm.getResistance (); 00024 pc.printf("Resistance : %.2f \n\r", atmos); 00025 00026 atmos = atm.getPPM (); 00027 pc.printf("RZero : %.2f \n\r", atmos); 00028 00029 wait (1); 00030 } 00031 } 00032
Generated on Wed Jul 20 2022 02:05:43 by 1.7.2