pyupm_kxcjk1013 module¶
-
class
pyupm_kxcjk1013.
KXCJK1013
(device)[source]¶ Bases:
object
KXCJK1013 Tri-axis Digital Accelerometer API.
ID: kxcjk1013
Name: Tri-axis Digital Accelerometer
Category: accelerometer
Manufacturer: kionix
Connection: iio i2c
Link:http://kionixfs.kionix.com/en/datasheet/KXCJK-1013%20Specifications%20Rev%202.pdf The KXCJK is a tri-axis +/-2g, +/-4g or +/-8g silicon micromachined accelerometer.
C++ includes: kxcjk1013.hpp
-
enableBuffer
(length)[source]¶ bool enableBuffer(int length)
Enable trigger buffer
length: buffer length in integer
-
extract3Axis
(data, x, y, z)[source]¶ void extract3Axis(char *data, float *x, float *y, float *z)
Process enabled channel buffer and return x, y, z axis
data: Enabled channel data, 6 bytes, each axis 2 bytes
x: X-Axis
y: Y-Axis
z: Z-Axis
-
getChannelValue
(input, chan)[source]¶ int64_t getChannelValue(unsigned char *input, mraa_iio_channel *chan)
Extract the channel value based on channel type
input: Channel data
chan: MRAA iio-layer channel info
-
installISR
(isr, arg)[source]¶ void installISR(void(*isr)(char *, void *), void *arg)
Installs an interrupt service routine (ISR) to be called when an interrupt occurs
isr: Pointer to a function to be called on interrupt
arg: Pointer to an object to be supplied as an argument to the ISR.
-
setSamplingFrequency
(sampling_frequency)[source]¶ bool setSamplingFrequency(const float sampling_frequency)
Set sampling frequency
sampling_frequency: 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
-