- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I want to get the three coordinates values of the magnetic field measured by the sensor of my phone. For this, I get a handle to the SensorManager
by using sm=(SensorManager)getApplicationContext().getSystemService(Context.SENSOR_SERVICE)
, then get the sensor with cm=sm.getDefaultSensor(SensorManager.SENSOR_MAGNETIC_FIELD)
. I then register a SensorEventListener
to the SensorManager
with sm.registerListener(new SensorListener(),cm,SensorManager.SENSOR_DELAY_UI)
.
The classSensorListener
is a class of my own implementing the SensorEventListener
interface. In it's OnSensorChanged
method, I get the values from the sensor and I display them. The problem is that I only get the values 1,0 and 0. And they are rarely updated (I have put a counter on the onSensorChanged
calls to see how often the update takes place). Changing the time to SENSOR_DELAY_NORMAL
doesnot improve anything.
To check if the problem was related to the magnetic sensor, I have added, in the same way, a listener to an accelerometer sensor. The result is very confusing : now, the magnetic sensor generates updates, but not the accelerometer one. And if I remove the accelerometer omegle.2yu.co sensor event listener, I still receive the magnetic sensor events which where missing before adding the accelerometer sensor event listener.(???????????)
- Labels:
-
Hall Switches
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @WaltSnowrancruz ,
This forum is for Infineon Products and we regret that we cannot offer support for your issue. Do let us know if you face any issues with our products.
Best Regards,
Deepa