Hallo Merlin, ich habe etwas gefunden, aber nur in C++
//T[C] = -45 +175 * ST / 2^16 -1 <-- Formel aus Datasheet
float sht31_calculate_temperature(SHT31 *sensor) {
return (((sensor->read_buffer[0] << 8)| sensor->read_buffer[1]) * 175.0) / 65535.0 - 45.0;
}
//RH = 100 * SRH / 2^16 -1
float sht31_calculate_humudity(SHT31 *sensor) {
return (((sensor->read_buffer[3] << 8) | sensor->read_buffer[4])) * 100.0 / 65535.0;
}
Gruß Frank
Code
//T[C] = -45 +175 * ST / 2^16 -1 <-- Formel aus Datasheet
float sht31_calculate_temperature(SHT31 *sensor) {
return (((sensor->read_buffer[0] << 8)| sensor->read_buffer[1]) * 175.0) / 65535.0 - 45.0;
}
//RH = 100 * SRH / 2^16 -1
float sht31_calculate_humudity(SHT31 *sensor) {
return (((sensor->read_buffer[3] << 8) | sensor->read_buffer[4])) * 100.0 / 65535.0;
}
Gruß Frank