How Lis302dl detect slight rotation?

hamody at
Mon Oct 27 04:05:25 CET 2008

Simon Kagstrom wrote:
> On Fri, 24 Oct 2008 00:47:39 -0700 (PDT)
> hamody < at> wrote:
>> Lis302dl send data to app by interrupt mode.Now there is a
>> problem,how does the sensor detect 
>> very slight phone rotation?
>> In my case,though the threshold&duration is sensitive,but it still
>> cannot trigger the interrupt when 
>> the phone slightly rotate.
>> Any suggestion to solve it?
> I've also thought about this, and I think it can be solved at the
> application level (probably some daemon which will export the interface
> further). What the daemon can do is to first set a threshold, and when
> the daemon wakes up because of new data (the device is moved), it can
> set the threshold to zero (to just spew out all data) in sysfs.
> When the device has been still for some configurable time (by reading
> samples at some interval), the daemon can again setup a threshold and
> go back to sleep.
> I guess this would go into odeviced in the Openmoko case.
> // Simon

Hello Simon

Your idea is useful and good.Also I have two ideas.

1) Mark four degree types ,which indicate 0,90,180,270 degree of the phone
status.And follow there are two ways for that.One is ,we in driver set the
interrupt very sensitive ,and before report the event,be sure the data is in
the above four degree types.This type can act well only the driver works for
screen rotation.I think it's bad.Second we voluntarily read the data at a
quite a long interval time(1s? or less),this ensure it will not hold much
resource.Then determine and report the data if belong to the four degree
types or not.

2) We assume the phone is in two status:1 people rotate the phone. 2 the
phone is static.
In the first status,we assume the interrupt is able to detect and no one
miss.But if the case the very slight rotation interrupt missed happen,we
regard it as static.So we also assume the resource is enough(I also think
one second to read the data will not hold much) and we set a timer to read
the data voluntarily.Note that this only happen the phone is in static
status,which no interrupt will trigger and report .
This can be done after some time the interrupt is quiet.We assume now the
phone is static.Then read the data at a interval,and determine whether
report it or not as a interrupt.

I think the last method will do some interesting thing.


China is a great country.Welcome to Beijing.
View this message in context:
Sent from the Openmoko Kernel mailing list archive at

More information about the openmoko-kernel mailing list