AirQualityClick on A0 on Nucleo-F411RE
Diff: main.cpp
- Revision:
- 0:415a45341fd5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Apr 14 11:37:04 2015 +0000 @@ -0,0 +1,32 @@ +#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); + } +} + \ No newline at end of file