pyupm_enc03r module

class pyupm_enc03r.ENC03R(pin, aref=5.0)[source]

Bases: object

API for the ENC03R Single Axis Analog Gyro.

ID: enc03r

Name: Single-axis Analog Gyro Module

Other Names: Grove Single Axis Analog Gyro

Category: compass

Manufacturer: seeed

Connection: analog

Kit: robok

Link:http://www.murata.com/en-us/products/productdetail?partno=ENC- 03RC-R UPM module for the ENC03R single axis analog gyro. This gyroscope measures x-axis angular velocity, that is how fast the sensor is rotating around the x-axis. Calibration of the sensor is necessary for accurate readings.

C++ includes: enc03r.hpp

angularVelocity()[source]

float angularVelocity()

Computes angular velocity based on the value and stored calibration reference.

val: Value to use to compute angular velocity

Computed angular velocity

calibrate(samples)[source]

void calibrate(unsigned int samples)

Calibrates the sensor by determining an analog reading over many samples with no movement of the sensor. This must be done before attempting to use the sensor.

samples: Number of samples to use for calibration

calibrationValue()[source]

float calibrationValue()

Returns the currently stored calibration value

Current calibration value

getNormalized()[source]

float getNormalized()

Get a normalized ADC value from the sensor. The return value will be between 0.0 (indicating no voltage) and 1.0 indicating max voltage (aref). update() must be called prior to calling this function.

The normalized reading from the ADC.

setOffset(offset)[source]

void setOffset(float offset)

Set sensor offset. The offset is applied to the return value before scaling. Default is 0.

offset: Offset to apply to value

setScale(scale)[source]

void setScale(float scale)

Set sensor scale. The return value is scaled by this value after the offset is applied. Default is 1.0.

scale: Scale to apply to value

update()[source]

void update()

Update the internal state with the current reading. This function must be called prior to calling angularVelocity().

dev: Device context