UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

ADXRS610 Class

Module: adxrs610

The ADXRS610 is a MEMS based single axis gyroscope with a range of +/- 300 degrees/sec. It also incorporates a temperature sensing unit that can be used for advanced calibration.
This sensor returns an analog voltage proportional to the rotation about the Z-axis in degrees/sec. The temperature component returns a proportional analog values in degrees C.
This driver was developed using the DFRobot ADXRS610 Gyro Breakout board.
adxrs610.jpg

Methods

ADXRS610

(
  • dPin
  • tPin
  • aref
)
Number

ADXRS610 constructor

Parameters:

  • dPin Number

    Analog pin to use for DATAOUT

  • tPin Number

    Analog pin to use for temperature measurement

  • aref Number

    Analog reference voltage; default is 5.0 V

Returns:

Number:

getDataVolts

() Number

Returns the voltage detected on the DATA analog pin

Returns:

Number:

The detected voltage

getTemperatureVolts

() Number

Returns the voltage detected on the TEMP analog pin

Returns:

Number:

The detected voltage

setDeadband

(
  • deadband
)

This method allows you to specify a deadband region around the zero point of the gyro (at rest). This can be used as a primitive filter to ignore movment around the zero point.

Parameters:

  • deadband Number

    The voltage around the zero point which will be ignored

setZeroPoint

(
  • zeroPoint
)

Set the zero point. This is the point measured and averaged when the sensor is not moving. It is set at construction time (averaged over a number of samples), but can be overridden here.

Parameters:

  • zeroPoint Number

    The averaged zero point of the sensor at rest

calibrateZeroPoint

(
  • samples
)
Number

This method samples the data pin samples times to produce an average. This value can then be used as the zero point ( setZeroPoint() ).

Parameters:

  • samples Number

    the number of samples to take an average over. The default is 50.

Returns:

Number:

the average of the reading over samples times.

getZeroPoint

() Number

Return the zero point value.

Returns:

Number:

the current zero point value

getTemperature

() Number

Return the measured temperature in Celsius. Note, the datasheet says that this value is very repeatable, but is not an accurate absolute temperature.

Returns:

Number:

the current temperature in C

getAngularVelocity

() Number

Return the measured angular velocity in degrees/sec.

Returns:

Number:

the current angular velocity in degrees/sec