projet capteur connecté ST/SE

Dependencies:   HP206C mbed HMC5883L DHT DS1820

Committer:
MathieuM
Date:
Mon Dec 10 11:26:41 2018 +0000
Revision:
82:6f5913a97489
Parent:
64:7adaa9dfcb8c
Various updates

Who changed what in which revision?

UserRevisionLine numberNew contents of line
SBACCARI 20:ee252c87a24d 1 #include "mbed.h"
MathieuM 37:2b7e44977ed5 2 #include "DHT.h"
MathieuM 45:60f602ecd59b 3 #include "config.h"
SBACCARI 50:2cbcbc06ceb6 4 /* ************************ MODE D'EMPLOI *****************************************************
SBACCARI 54:61d003e0754d 5 This file contains functions to use with DHT22 sensor
SBACCARI 54:61d003e0754d 6 Reading humidity and temperature values cannot be done simultaneously
SBACCARI 54:61d003e0754d 7 At least 2s of wait time is needed between fetching the temprature value and the humidity value
SBACCARI 54:61d003e0754d 8 Documentaation and biblipgraphy note that the sensor is slow and so values will have a delay of a few seconds compared to real life
SBACCARI 54:61d003e0754d 9
SBACCARI 54:61d003e0754d 10 The following code works perfectly on its own :
SBACCARI 54:61d003e0754d 11
SBACCARI 50:2cbcbc06ceb6 12 airH = airHumidity(sensor);
SBACCARI 50:2cbcbc06ceb6 13 if( airH!=0){
SBACCARI 50:2cbcbc06ceb6 14 pc.printf("H = %.2f pourcent \r\n", airH);
SBACCARI 50:2cbcbc06ceb6 15 }
SBACCARI 50:2cbcbc06ceb6 16
SBACCARI 50:2cbcbc06ceb6 17 wait(2);
SBACCARI 50:2cbcbc06ceb6 18
SBACCARI 50:2cbcbc06ceb6 19 airT = airTemperature(sensor);
SBACCARI 50:2cbcbc06ceb6 20 if( airT!=0 ){
SBACCARI 50:2cbcbc06ceb6 21 pc.printf("T = %.2f \r\n", airT);
SBACCARI 50:2cbcbc06ceb6 22 }
SBACCARI 50:2cbcbc06ceb6 23 *************************************************************************************************/
SBACCARI 50:2cbcbc06ceb6 24
SBACCARI 29:e050039204ab 25
MathieuM 46:40b6bbf6167e 26 float airHumidity(DHT sensor);
SBACCARI 62:d902b1e77094 27 float airTemperature(DHT sensor);
SBACCARI 64:7adaa9dfcb8c 28 void get_T_H_air(float* T, float* H, DHT sensor);