Arduino_ICM20948_DMP_Full-Function
Arduino_ICM20948_DMP_Full-Function copied to clipboard
Getting temeprature from ICM20948
Hi,
I was attempting to modify this library to also pull the temperature, but I seem to have hit a roadblock. In build_sensor_event_data I was adding
case INV_SENSOR_TYPE_TEMPERATURE:
memcpy(&(event.data.temperature.tmp), data, sizeof(event.data.temperature.tmp));
temperature = event.data.temperature.tmp;
temp_data_ready = true;
break;
where temperature
is a float and temp_data_ready
is a bool to match the other variables.
in init
I added the appropriate lines for the temperature sensor
rc = inv_icm20948_set_sensor_period(&icm_device, idd_sensortype_conversion(INV_SENSOR_TYPE_TEMPERATURE), 1000 / settings.temp_frequency);
rc = inv_icm20948_enable_sensor(&icm_device, idd_sensortype_conversion(INV_SENSOR_TYPE_TEMPERATURE), settings.enable_temp);
But it seems that only 0 is returned for the data, is there a different sensor that I should be using?