: lsm6dso

LSM6DSO 6 degrees sensor

Methods

: obj = lsm6dso(arObj)
: obj = lsm6dso(arObj, propertyname, propertyvalue ....)

Constructor to create LSM6DSO sensor

Inputs

arObj - the arduino parent object

propertyname, propertyvalue - optional property name, value pairs. Current known properties are: Current properties are:

I2CAddress

I2C address of the sensor (default 0x40)

Bus

I2C bus - 0 or 1 (default 0)

Outputs

obj - created object

Example


a = arduino()
sensor = lsm6dso(a)

: [C, timestamp] = readTemperature(obj)

Read the temperature

Inputs

obj - the sensor object

Outputs

C - read temperature in deg C.

timestamp - timestamp when read

Example


a = arduino()
s = lsm6dso(a)
# get temp
temp = s.readTemperature

See also: lsm6dso.

: [readVal, timestamp] = readAcceleration(obj)

Read the acceleration rate

Inputs

obj - the sensor object

Outputs

readVal - the 3 acceleration values

timestamp - timestamp when read

: [readVal, timestamp] = readAngularVelocity(obj)

Read the angular velocity

Inputs

obj - the sensor object

Outputs

readVal - the 3 angular velocity values

timestamp - timestamp when read

: [readings, overrun] = read(obj)
: [accel, gyro, mag, timestamp, overrun] = read(obj)

Read the sensor data

Inputs

obj - the sensor object

Outputs

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.

: inf = info(obj)

Read the sensor info

Inputs

obj - the sensor object

Outputs

inf - structure containing the sensor information.

Structure fields are:

SensorId

sensor id value

Type

sensor type ’lsm6dso’

: flush(obj)

Flush sensor data

Inputs

obj - the sensor object

Outputs

None

: release(obj)

Release the resources of the sensor

Inputs

obj - the sensor object

Outputs

None

Package: arduino