projet capteur connecté ST/SE

Dependencies:   HP206C mbed HMC5883L DHT DS1820

Committer:
MathieuM
Date:
Mon Oct 01 10:32:14 2018 +0000
Revision:
46:40b6bbf6167e
Parent:
45:60f602ecd59b
Child:
50:2cbcbc06ceb6
updated main

Who changed what in which revision?

UserRevisionLine numberNew contents of line
SBACCARI 29:e050039204ab 1 #include "T_H_air.h"
MathieuM 45:60f602ecd59b 2 #include "config.h"
SBACCARI 29:e050039204ab 3
MathieuM 46:40b6bbf6167e 4 float airHumidity(DHT sensor){
MathieuM 46:40b6bbf6167e 5 DigitalOut warningAir(W_AIR);
SBACCARI 29:e050039204ab 6 int err = 0;
SBACCARI 29:e050039204ab 7
SBACCARI 29:e050039204ab 8 err = sensor.readData();
SBACCARI 29:e050039204ab 9 if( !err ){
SBACCARI 29:e050039204ab 10 return sensor.ReadHumidity() ;
SBACCARI 29:e050039204ab 11 }
SBACCARI 40:0b19a258c614 12 warningAir = 1;
SBACCARI 29:e050039204ab 13 return EXIT_FAILURE ;
SBACCARI 41:d3434f5816ad 14 }
SBACCARI 41:d3434f5816ad 15
MathieuM 46:40b6bbf6167e 16 float airTemperature(DHT sensor){
MathieuM 46:40b6bbf6167e 17 DigitalOut warningAir(W_AIR);
SBACCARI 41:d3434f5816ad 18 int err = 0;
SBACCARI 41:d3434f5816ad 19
SBACCARI 41:d3434f5816ad 20 err = sensor.readData();
SBACCARI 41:d3434f5816ad 21 if( !err ){
SBACCARI 41:d3434f5816ad 22 return sensor.ReadTemperature(CELCIUS) ;
SBACCARI 41:d3434f5816ad 23 }
SBACCARI 41:d3434f5816ad 24 warningAir = 1;
SBACCARI 41:d3434f5816ad 25 return EXIT_FAILURE ;
SBACCARI 29:e050039204ab 26 }