Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: HP206C mbed HMC5883L DHT DS1820
T_H_air.cpp
- Committer:
- SBACCARI
- Date:
- 2018-10-09
- Revision:
- 65:3f898ad77cb5
- Parent:
- 64:7adaa9dfcb8c
File content as of revision 65:3f898ad77cb5:
#include "T_H_air.h" #include "config.h" float airHumidity(DHT sensor) { DigitalOut warningAir(W_AIR); int err = 0; err = sensor.readData(); while( !err ) { err = sensor.readData(); return sensor.ReadHumidity() ; } return 0; } float airTemperature(DHT sensor) { DigitalOut warningAir(W_AIR); int err = 0; err = sensor.readData(); while( !err ) { err = sensor.readData(); return sensor.ReadTemperature(CELCIUS) ; } return 0; } void get_T_H_air(float* T, float* H, DHT sensor) { float tmpH, tmpT ; tmpT = airTemperature(sensor); if( tmpT!=0 ) { *T=tmpT; } wait(2); tmpH = airHumidity(sensor); if( tmpH!=0) { *H = tmpH; } }