Skip to main content
Visitor II
January 30, 2020
Question

[LSM303AGR] The compass does not work.

  • January 30, 2020
  • 1 reply
  • 644 views

The LSM303AGR chip is used in Android device. 

I use STMems_Android_Sensor_HAL_Input sensor HAL from https://www.st.com/content/st_com/en/products/embedded-software/mems-and-sensors-software/drivers-for-mems/androidhalinput.html.

The magnetometer works but the compass does not work. The following logs appear when compass app is launched.

01-21 08:34:08.785 4367 4367 I CompassSensorActivity: ORIENTATION sensor not found

01-21 08:34:08.811 4367 4367 E SensorManager: sensor or listener is null

How do I configure ENABLED_MODULES in the Android.mk of STMems_Android_Sensor_HAL_Input ?

    This topic has been closed for replies.

    1 reply

    Visitor II
    January 30, 2020

    I try to enable SENSOR_ST_COMPASS but there is building error due to lack of conf_COMPASS.h.

    #if defined(SENSOR_ST_COMPASS)

     #include "conf_COMPASS.h"

    #endif