Hi, pramod gurav wrote: > On Sat, May 23, 2009 at 4:19 PM, Michael Trimarchi > <[email protected]> wrote: > >> Hi all, >> >> Is there a good example or an howto to write a libsensors library or >> just take a look >> at the includes and frameworks code to understand how it works? >> >> Michael >> >> > Hi Michael, > You can refer the qemu sensor implementation to write your own sensor library. > Look at development/emulator/sensors/ > Even look at hardware/libhardware/include/hardware/sensors.h for reference. > > I write the sensor driver and the code can be used as an example here:
http://git.moko.serdar-dere.net/?p=projects/hardware/libsensors.git;a=blob; f=sensors.c;h=4b64ee7156823c060e331c7ca339c6a71030f607;hb=HEAD But I have some few question: - is it possible to have two accelerometer in android? - and I take the event from poll function but I don't obtain all the rotation. These are some data: D/sensors ( 844): sensors_poll: sensor event -1.260855, 9.546474, -1.260855 D/sensors ( 844): sensors_poll: sensor event 9.006107, 0.180122, -1.080733 <== first rotation D/sensors ( 844): sensors_poll: sensor event -0.720489, -11.347695, -0.720489 <== no rotation D/sensors ( 844): sensors_poll: sensor event 8.465741, 0.900611, -0.900611 <== no rotation D/sensors ( 844): sensors_poll: sensor event -1.080733, 9.366352, -1.801221 <== rotation I think that the data is correct but I don't understand exactly how the rotation works Michael > > > > --~--~---------~--~----~------------~-------~--~----~ unsubscribe: [email protected] website: http://groups.google.com/group/android-porting -~----------~----~----~----~------~----~------~--~---
