User talk:Gromgull

From Openmoko

Jump to: navigation, search


Thank for the correction for the "accelerometer" page. I don't understand but if I modify the page, space disapear.

Could you add this lines

Equivalent in Perl


$x = 0;
$y = 0;
$z = 0;

$secondsensorfile = "/dev/input/event3";
#open file in binary mode
open FILE, $secondsensorfile;
binmode FILE;

while (read FILE, $buf,16) {
    ($t1,$t2,$type,$code,$value)=unpack "iissi",$buf;
    if ($type==2) {
	if ($code==0) {$x=$value};
	if ($code==1) {$y=$value};
	if ($code==2) {$z=$value};
    if (($type==0) && (code==0)) {
        printf "%f %05d %05d %05d\n",$t1+$t2/1000000,$x,$y,$z;


Personal tools