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.

CurieImu Class

Module: curieimu
  • ID: curieimu
  • Name: Curie IMU Sensor using Firmata
  • Other Names: Curie IMU Sensor for Arduino/Genuino 101 running Firmata
  • Category: serial accelerometer compass
  • Manufacturer: bosch
  • Connection: uart

Curie IMU is a 6-axis accelerometer
This module has been tested on an Arduino/Genuino 101 running ConfigurableFirmata with CurieIMU

Methods

CurieImu

(
  • subplatform_offset
)
Number

Instantiates a CurieImu object

Parameters:

  • subplatform_offset Number

    Subplatform offset

Returns:

Number:

updateAccel

()

Updates the latest accelerometer readings by calling Firmata

updateGyro

()

Updates the latest gyroscope readings by calling Firmata

updateMotion

()

Updates the both the latest accelerometer & gyroscope readings by calling Firmata

getAccel

() Int16_t *

Returns last accelerometer reading X, Y, and Z axis

Returns:

Int16_t *:

pointer to array with X-axis, Y-axis & Z-axis value

getAccelX

() Number

Returns last accelerometer reading X axis

Returns:

Number:

X-axis value

getAccelY

() Number

Returns last accelerometer reading Y axis

Returns:

Number:

Y-axis value

getAccelZ

() Number

Returns last accelerometer reading Z axis

Returns:

Number:

Z-axis value

getGyro

() Int16_t *

Read gyroscope X, Y, and Z axis

Returns:

Int16_t *:

pointer to array with X-axis, Y-axis & Z-axis value

getGyroX

() Number

Returns last gyroscope reading X axis

Returns:

Number:

X-axis value

getGyroY

() Number

Returns last gyroscope reading Y axis

Returns:

Number:

Y-axis value

getGyroZ

() Number

Returns last gyroscope reading Z axis

Returns:

Number:

Z-axis value

getTemperature

() Number

Reads the internal temperature

Returns:

Number:

16-bit integer containing the scaled temperature reading

getMotion

() Int16_t *

Reads the X, Y, and Z axis of both gyroscope and accelerometer

Returns:

Int16_t *:

pointer to array with X-axis, Y-axis & Z-axis values for accelerometer, and then X-axis, Y-axis & Z-axis values for gyroscope

getAxis

() Number

Returns last shock or tap axis reading

Returns:

Number:

axis value

getDirection

() Number

Returns last shock or tap direction reading

Returns:

Number:

direction value

enableShockDetection

(
  • enable
)

Turns shock detection notifications on/off

Parameters:

  • enable Boolean

    enables/disables notifications

isShockDetected

() Boolean

Has there been a shock detected?

Returns:

Boolean:

true if any unprocessed shock notifications are in the queue

getNextShock

()

Gets shock detect data from queue. Then m_axis gets axis data, and m_direction gets direction data

enableStepCounter

(
  • enable
)

Turns step counter notifications on/off

Parameters:

  • enable Boolean

    enables/disables notifications

isStepDetected

() Boolean

Has there been a step detected?

Returns:

Boolean:

true if any unprocessed step notifications are in the queue

getStepCount

() Number

Gets step count data from queue

Returns:

Number:

the total number of steps taken

enableTapDetection

(
  • enable
)

Turns tap detection notifications on/off

Parameters:

  • enable Boolean

    enables/disables notifications

isTapDetected

() Boolean

Has there been a tap detected?

Returns:

Boolean:

true if any unprocessed tap notifications are in the queue

getNextTap

()

Gets tap detect data from queue. Then m_axis gets axis data, and m_direction gets direction data

lock

()

Locks responses from Firmata

unlock

()

Unlocks responses from Firmata

waitForResponse

()

Wait for a response from Firmata before proceeding

proceed

()

Proceed with original function call now that response from Firmata has been received

setResults

(
  • buf
  • length
)

Set results being returned from Firmata for processing

Parameters:

  • buf Uint8_t *

    is the buffer

  • length Number

    is the length of results buffer

processResponse

()

Processes asyncronous responses returned from Firmata