L3GD20: this class provides functions for the gyroscope of the LSM303 IC for read and write operations.
More...
|
| gyroScaleFactor |
|
| gyroSampleCount |
|
| gyroLastMesuredTime |
|
| address |
|
| bus |
|
|
int | XAXIS = 0 |
|
int | YAXIS = 1 |
|
int | ZAXIS = 2 |
|
tuple | GYRO_ADDRESS = (0xD6) |
|
int | L3G20D_WHO_AM_I = 0x0F |
|
int | L3G20D_CTRL_REG1 = 0x20 |
|
int | L3G20D_CTRL_REG2 = 0x21 |
|
int | L3G20D_CTRL_REG3 = 0x22 |
|
int | L3G20D_CTRL_REG4 = 0x23 |
|
int | L3G20D_CTRL_REG5 = 0x24 |
|
int | L3G20D_REFERENCE = 0x25 |
|
int | L3G20D_OUT_TEMP = 0x26 |
|
int | L3G20D_STATUS_REG = 0x27 |
|
int | L3G20D_OUT_X_L = 0x28 |
|
int | L3G20D_OUT_X_H = 0x29 |
|
int | L3G20D_OUT_Y_L = 0x2A |
|
int | L3G20D_OUT_Y_H = 0x2B |
|
int | L3G20D_OUT_Z_L = 0x2C |
|
int | L3G20D_OUT_Z_H = 0x2D |
|
int | L3G20D_FIFO_CTRL_REG = 0x2E |
|
int | L3G20D_FIFO_SRC_REG = 0x2F |
|
int | L3G20D_INT1_CFG = 0x30 |
|
int | L3G20D_INT1_SRC = 0x31 |
|
int | L3G20D_INT1_THS_XH = 0x32 |
|
int | L3G20D_INT1_THS_XL = 0x33 |
|
int | L3G20D_INT1_THS_YH = 0x34 |
|
int | L3G20D_INT1_THS_YL = 0x35 |
|
int | L3G20D_INT1_THS_ZH = 0x36 |
|
int | L3G20D_INT1_THS_ZL = 0x37 |
|
int | L3G20D_INT1_DURATION = 0x38 |
|
float | RAD_TO_DEG = 57.29578 |
|
float | M_PI = 3.14159265358979323846 |
|
int | gyroSampleCount = 0 |
|
list | gyroSample = [0,0,0] |
|
int | gyroHeading = 0 |
|
tuple | gyroLastMesuredTime = time.time() |
|
float | gyroScaleFactor = 0.07 |
|
L3GD20: this class provides functions for the gyroscope of the LSM303 IC for read and write operations.
def OpenElectrons_L3GD20.L3GD20.__init__ |
( |
|
self, |
|
|
|
gyro_address = GYRO_ADDRESS |
|
) |
| |
Initialize the class with the i2c address of the L3GD20 and set function parameters for gyro.
- Parameters
-
self | The object pointer. |
i2c_address | Address of your gyro. |
def OpenElectrons_L3GD20.L3GD20.accel12 |
( |
|
self, |
|
|
|
list, |
|
|
|
idx |
|
) |
| |
Interprets signed 12-bit Gyro component from list.
- Parameters
-
self | The object pointer. |
array | The list of gyro data generated from the L3GD20 |
idx | The location of the desired element in the list |
def OpenElectrons_L3GD20.L3GD20.configL3GD20 |
( |
|
self, |
|
|
|
register, |
|
|
|
r_value |
|
) |
| |
Writes to a register to configure gyro.
- Parameters
-
self | The object pointer. |
register | The register address to write to the L3GD20. |
r_value | The value to write to the register. |
def OpenElectrons_L3GD20.L3GD20.deg2rad |
( |
|
self, |
|
|
|
d_value |
|
) |
| |
Converts degrees to radian.
- Parameters
-
self | The object pointer. |
d_value | The degree value to convert to radian. |
def OpenElectrons_L3GD20.L3GD20.int16 |
( |
|
self, |
|
|
|
list, |
|
|
|
idx |
|
) |
| |
Interprets signed 16-bit Gyro component from list.
- Parameters
-
self | The object pointer. |
array | The list of gyro data generated from the L3GD20 |
idx | The location of the desired element in the list |
def OpenElectrons_L3GD20.L3GD20.measureGyro |
( |
|
self | ) |
|
Reads the heading/angle value of the gyro.
- Parameters
-
def OpenElectrons_L3GD20.L3GD20.measureGyroSum |
( |
|
self | ) |
|
Reads the gyro sum value.
- Parameters
-
def OpenElectrons_L3GD20.L3GD20.rad2deg |
( |
|
self, |
|
|
|
r_value |
|
) |
| |
Converts radian to degrees.
- Parameters
-
self | The object pointer. |
r_value | The radian value to convert to degrees. |
def OpenElectrons_L3GD20.L3GD20.rangeSelect |
( |
|
self, |
|
|
|
range |
|
) |
| |
Sets the range for gyro.
- Parameters
-
self | The object pointer. |
range | The range to set the gyro. |
def OpenElectrons_L3GD20.L3GD20.read |
( |
|
self | ) |
|
Reads the x,y,z gyro values.
- Parameters
-
The documentation for this class was generated from the following file: