Freerunner games / using motion sensors in C

Robert Schuster theBohemian at gmx.net
Tue May 13 23:22:18 CEST 2008


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



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.openmoko.org/pipermail/community/attachments/20080513/68fc1294/attachment.pgp 


More information about the community mailing list