Sensor Object
Purpose:
Gives access to the cell phones internal sensors.
Syntax:
sensor.methodname where methodname is one of the following
values register unregister
list
Comments:
Example:
This command will register Goldfish 3-axis Accelerometer. After registering the sensor, you can access its current value.
sensor.register ss[0]
To unregister the sensor use the unregister method.
sensor.unregister ss[0]
You should only register the sensors you need, and when you are done with the sensor, you should unregister it to save battery life.
To access the sensors value, use the values method as shown below
sen1 = ss[0]
xx = sensor.values(0,sen1) Some sensors have multiple values, in the example above we are accessing the first value, index 0
xx2 = sensor.values(1,sen1)
Here we accessed the second value.