Mac::MotionSensor - Access to your accelerometer
use Mac::MotionSensor; my $sensor = Mac::MotionSensor->new; # scaled output my $x = $sensor->x; my $y = $sensor->y; my $z = $sensor->z; # raw output $x = $sensor->raw_x; $y = $sensor->raw_y; $z = $sensor->raw_z; $sendor->type;
This module wraps the UniMotion c library
All axis methods return a signed integer.
UniMotion won't build against x86_64, I am working on this issue
The UniMotion C library
http://unimotion.sourceforge.net/
http://github.com/robinedwards/Mac-MotionSensor
Robin Edwards, <rge@cpan.org>
Copyright (C) 2010 by Robin Edwards
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.1 or, at your option, any later version of Perl 5 you may have available.
UniMotion is distributed under the LGPL license.
To install Mac::MotionSensor, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mac::MotionSensor
CPAN shell
perl -MCPAN -e shell install Mac::MotionSensor
For more information on module installation, please visit the detailed CPAN module installation guide.