Freerunner games / using motion sensors in C

steve steve at openmoko.com
Wed May 14 00:13:59 CEST 2008


thanks andy.

Is this in the wiki ?

hint hint if its not

-----Original Message-----
From: community-bounces at lists.openmoko.org
[mailto:community-bounces at lists.openmoko.org] On Behalf Of Robert Schuster
Sent: Tuesday, May 13, 2008 2:22 PM
To: List for Openmoko community discussion
Subject: Re: Freerunner games / using motion sensors in C

Hi,
would be cool if someone can hook the accelerometers into libsdl and let
them look like a joystick ...

Regards
Robert

Andy Green schrieb:
> Somebody in the thread at some point said:
> 
> | If somebody tells me how to use the accelerometers, I will have a go. Is
> | it just like /dev/joydev ?
> 
> You just open /dev/input/event2 (top accel) and/or 3 (bottom).  Have a
> look in <cross path>/usr/include/linux/input.h -- basically these guys
> turn up in there 300 a second:
> 
> struct input_event {
>     struct timeval time;
>     __u16 type;    <==== type = 2
>     __u16 code;    <==== code = 0=X, 1=Y, 2=Z
>     __s32 value;   <==== signed mG force in 18mG steps
> };
> 
> -Andy

_______________________________________________
Openmoko community mailing list
community at lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community








More information about the community mailing list