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.

KXCJK1013 Class

Module: kxcjk1013

The KXCJK is a tri-axis +/-2g, +/-4g or +/-8g silicon micromachined accelerometer.

Methods

KXCJK1013

(
  • device
)
Number

KXCJK1013 Tri-axis Digital Accelerometer

Parameters:

  • device Number

    iio device number

Returns:

Number:

installISR

(
  • isr
  • arg
)

Installs an interrupt service routine (ISR) to be called when an interrupt occurs

Parameters:

  • isr Void()(char *, void *)

    Pointer to a function to be called on interrupt

  • arg Void *

    Pointer to an object to be supplied as an argument to the ISR.

getChannelValue

(
  • input
  • chan
)
Number

Extract the channel value based on channel type

Parameters:

  • input String

    Channel data

  • chan Mraa_iio_channel *

    MRAA iio-layer channel info

Returns:

Number:

enableBuffer

(
  • length
)
Boolean

Enable trigger buffer

Parameters:

  • length Number

    buffer length in integer

Returns:

Boolean:

disableBuffer

() Boolean

Disable trigger buffer

Returns:

Boolean:

setScale

(
  • scale
)
Boolean

Set scale

Parameters:

  • scale Number

    in float Available scales are 0.009582(2g), 0.019163(4g), and 0.038326(8g) Default scale is 0.019163

Returns:

Boolean:

setSamplingFrequency

(
  • sampling_frequency
)
Boolean

Set sampling frequency

Parameters:

  • sampling_frequency Number

    sampling frequency in float Available sampling frequency are 0.781000, 1.563000, 3.125000, 6.250000, 12.500000, 25, 50, 100, 200, 400, 800, and 1600 Default sampling frequency is 25

Returns:

Boolean:

enable3AxisChannel

() Boolean

Enable 3 axis scan element

Returns:

Boolean:

extract3Axis

(
  • data
  • x
  • y
  • z
)

Process enabled channel buffer and return x, y, z axis

Parameters:

  • data String

    Enabled channel data, 6 bytes, each axis 2 bytes

  • x Float *

    X-Axis

  • y Float *

    Y-Axis

  • z Float *

    Z-Axis