AirQualityClick on A0 on Nucleo-F411RE
main.cpp
- Committer:
- Guillaume31
- Date:
- 2015-04-14
- Revision:
- 0:415a45341fd5
File content as of revision 0:415a45341fd5:
#include "mbed.h" #include "Air.h" Serial pc(SERIAL_TX, SERIAL_RX); //AnalogIn atm (A0); Air atm (A0); float atmos; int temp = 20, hum = 40; int main() { pc.printf("Debut programme \n\r"); pc.printf("Temperature = 20 C, Humidite = 40%% \n\r"); while(1) { //atmos = atm.read(); atmos = atm.getPPM (); pc.printf("PPM : %.2f \n\r", atmos); atmos = atm.getResistance (); pc.printf("Resistance : %.2f \n\r", atmos); atmos = atm.getPPM (); pc.printf("RZero : %.2f \n\r", atmos); wait (1); } }