Other Parts Discussed in Thread: HDC2080
Hi,
I am using dmm_154sensor_remote_display_oad_lpstk_app example program as base for my project. I notice that the HDC2080 temperature sensor data sent to the collector has no decimal places. I reviewed the code the HDC2080 temperature sensor is read to a float value. If I am not mistaken float size is 5.
lpstk.c
//get last temp float Lpstk_getTemperature() { return lpstkSensors.temperature; }
Then at sensor.c the float is type cast to uint16_t, which is size 2 if I am not mistaken. So, maybe that is the reason the decimal places are removed. We, need the temperature decimal places. Is the reason for type cast to uin16_t is because at collector csf.c CUI_statusLinePrintf() can not print in float format?
sensor.c
static void readSensors(void) { #if defined(TEMP_SENSOR) /* Read the temp sensor values */ tempSensor.ambienceTemp = Ssf_readTempSensor(); tempSensor.objectTemp = tempSensor.ambienceTemp; #endif #ifdef LPSTK Lpstk_Accelerometer accel; humiditySensor.temp = (uint16_t)Lpstk_getTemperature(); humiditySensor.humidity = (uint16_t)Lpstk_getHumidity();
-kel