The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Device::Gyroscope::L3GD20 - I2C interface to Gyroscope on the L3GD20 using Device::SMBus

VERSION

version 0.004

REGISTERS

CTRL_REG1

CTRL_REG4

OUT_X_H

OUT_X_L

OUT_Y_H

OUT_Y_L

OUT_Z_H

OUT_Z_L

ATTRIBUTES

I2CDeviceAddress

Containd the I2CDevice Address for the bus on which your gyroscope is connected. It would look like 0x6b. Default is 0x6b.

gyroscopeGain

Unless you are modifying gyroscope setup you must not change this. This contains the Gyroscope gain value which helps in converting the raw measurements from gyroscope register in to degrees per second.

XZero

This is the raw value for the X axis when the gyro is stationary. This is a part of gyro calibration to get more accurate values for rotation.

YZero

This is the raw value for the Y axis when the gyro is stationary. This is a part of gyro calibration to get more accurate values for rotation.

ZZero

This is the raw value for the Z axis when the gyro is stationary. This is a part of gyro calibration to get more accurate values for rotation.

lastReadingTime

Time when the last reading was taken

timeDrift

time taken between last reading and current reading. Make sure to take atleast two readings before you use this value for any calculations in your program otherwise you will get a bad value in this the first time you read the gyroscope.

METHODS

enable

    $self->enable()

Initializes the device, Call this before you start using the device. This function sets up the appropriate default registers. The Device will not work properly unless you call this function

getRawReading

    $self->getRawReading()

Return raw readings from accelerometer registers. Note that if XZero,YZero or ZZero are set, this function returns the values adjusted from the values at default non rotating state of the gyroscope. Its recommended that you set these values to achieve accurate results from the gyroscope.

getReading

Return gyroscope readings in degrees per second

calibrate

Placeholder for documentation on calibration

AUTHOR

Shantanu Bhadoria <shantanu at cpan dott org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Shantanu Bhadoria.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.