Light sensor code returning limited range of values
<p>I'm trying to code a very basic lightmeter application for use with my old 35mm cameras using my Galaxy S2 as the sensor. </p>

<p>I should point out first of all that there is a hidden/test mode available on this phone selected by entering <strong>star hash zero star hash</strong>, on the dialller keypad then selecting 'sensor'. This makes available the light sensor which shows a range of Lux values varying between 5 and over 2000 in steps of 5 as I vary the light level.</p>

<p>The very simple proof of concept code I have written will only show me three values, namely 10, 100 and 1000 over the same range of lighting condtions. My code is:</p>

<pre><code>public class LightMeterActivity extends Activity implements SensorEventListener {

    private SensorManager mSensorManager;
    private Sensor mLightSensor;
    private float mLux = 0.0f;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
        mLightSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);
    }

    @Override
    protected void onResume() {
        super.onResume();
        mSensorManager.registerListener(this, mLightSensor,
                SensorManager.SENSOR_DELAY_FASTEST);
    }

    @Override
    protected void onPause() {
        mSensorManager.unregisterListener(this);
        super.onPause();
    }

    @Override
    public void onAccuracyChanged(Sensor arg0, int arg1) {}

    @Override
    public void onSensorChanged(SensorEvent event) {
        if (event.sensor.getType() == Sensor.TYPE_LIGHT) {
            mLux = event.values[0];
            String luxStr = String.valueOf(mLux);
            TextView tv = (TextView) findViewById(R.id.textView1);
            tv.setText(luxStr);
            Log.d("LUXTAG", "Lux value: " + event.values[0] );

        }
    }
}
</code></pre>

<p>Can anybody suggest why this might be?</p>

<p>I have seen the question <a href="http://stackoverflow.com/questions/3479015/light-sensor-on-nexus-one-returns-only-two-distinct-values">Light sensor on Nexus One returns only two distinct values</a>
which didn't help at all. I can't understand how the built in test mode can see the full range and my code can't.</p>
