example for SHT25 humidity and temperature sensor

Dependencies:   mbed lib_SHT25

main.cpp

Committer:
YSI
Date:
2018-06-18
Revision:
0:885179b0efef
Child:
1:e13ad6081cb3

File content as of revision 0:885179b0efef:

#include "mbed.h"
#include "lib_SHT25.h"
 
Serial pc(USBTX, USBRX);
SHT25  sensor(p28, p27);

int main()
{
    float temperature, humidity;
    while(1)
    {
        sensor.getData(&temperature, &humidity);
        pc.printf("\rtemperature = %6.2f%cC -|- humidity = %6.2f%%RH", temperature, 248, humidity);
        wait(0.5);
    }
}