Hi All,

Hoping someone can help me make sense of my problem,  Using eclipse to
create a v1.5 compass application for my tmobile G1.  What i'm
experiencing is wacky heading results from the orientation sensor.

the important bits of my code are :

the setup of the sensor is >>

sensorManager = (SensorManager)getSystemService
(Context.SENSOR_SERVICE);
if (sensorManager != null) {
        Sensor orsensor = sensorManager.getSensorList
(Sensor.TYPE_ORIENTATION).get(0);
        sensorManager.registerListener(sensorListener, orsensor,
SensorManager.SENSOR_DELAY_NORMAL);
}

And my listener is defined as :
private final SensorEventListener sensorListener = new
SensorEventListener() {

                public void onAccuracyChanged(Sensor sensor, int accuracy) {}

                public void onSensorChanged(SensorEvent event) {
                        updateOrientation(event.values[0],
                                        event.values[1],
                                        event.values[2]);
                        Log.d("sensor","Sensor event: 
"+event.sensor.toString()+"//
"+event.values[0]+" "+event.values[1]+" "+event.values[2]);

                }
        };



When I run the app',  my heading values are always being reported as
being between 250 - 270 and don't alter from that irrelevant of which
way I'm pointing the device.

Theres nothing physically wrong with the hardware as all other apps
which use the sensors work fine so i'm confused, i'm sure its
something silly i've missed off.

If anyone can see a problem, please let me know it's greatly
appreciated..

Thanks

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to