Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting temeprature from ICM20948 #9

Open
x9prototype opened this issue Aug 10, 2024 · 0 comments
Open

Getting temeprature from ICM20948 #9

x9prototype opened this issue Aug 10, 2024 · 0 comments

Comments

@x9prototype
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant