MPU-6050 6 degrees sensor
Constructor to create MPU-6050 sensor
arObj - the arduino parent object
propertyname, propertyvalue - optional property name, value pairs. Current known properties are: Current properties are:
I2C address of the sensor (default 0x40)
I2C bus - 0 or 1 (default 0)
obj - created object
a = arduino()
sensor = mpu6050(a)
Read the temperature
obj - the sensor object
C - read temperature in deg C.
timestamp - timestamp when read
a = arduino()
s = mpu6050(a)
# get temp
temp = s.readTemperature
See also: mpu6050.
Read the acceleration rate
obj - the sensor object
readVal - the 3 acceleration values
timestamp - timestamp when read
Read the angular velocity
obj - the sensor object
readVal - the 3 angular velocity values
timestamp - timestamp when read
Read the sensor data
obj - the sensor object
accel - acceleration reading from sensor.
gyro - angular acceleration reading from sensor.
timestamp - timestamp when read
overrun - overrun flag.
readings - table structure with fields for Timestamp, Acceleration, AngularVelocity.
Read the sensor info
obj - the sensor object
inf - structure containing the sensor information.
Structure fields are:
sensor id value
sensor type ’mpu6050’
Flush sensor data
obj - the sensor object
None
Release the resources of the sensor
obj - the sensor object
None
Package: arduino