NAME

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

VERSION

version 0.010

ATTRIBUTES

I2CDeviceAddress

Contains 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.

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 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.

getReadingDegreesPerSecond

Return gyroscope readings in degrees per second

getReadingRadiansPerSecond

Return gyroscope readings in radians per second

calibrate

Placeholder for documentation on calibration

REGISTERS

CTRL_REG1

CTRL_REG4

OUT_X_H

OUT_X_L

OUT_Y_H

OUT_Y_L

OUT_Z_H

OUT_Z_L

AUTHOR

Shantanu Bhadoria <shantanu at cpan dott org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 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.