CurieImu Class
- 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
Item Index
Methods
- CurieImu
- updateAccel
- updateGyro
- updateMotion
- getAccel
- getAccelX
- getAccelY
- getAccelZ
- getGyro
- getGyroX
- getGyroY
- getGyroZ
- getTemperature
- getMotion
- getAxis
- getDirection
- enableShockDetection
- isShockDetected
- getNextShock
- enableStepCounter
- isStepDetected
- getStepCount
- enableTapDetection
- isTapDetected
- getNextTap
- lock
- unlock
- waitForResponse
- proceed
- setResults
- processResponse
Methods
CurieImu
-
subplatform_offset
Instantiates a CurieImu object
Parameters:
-
subplatform_offset
NumberSubplatform offset
Returns:
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:
pointer to array with X-axis, Y-axis & Z-axis value
getAccelX
()
Number
Returns last accelerometer reading X axis
Returns:
X-axis value
getAccelY
()
Number
Returns last accelerometer reading Y axis
Returns:
Y-axis value
getAccelZ
()
Number
Returns last accelerometer reading Z axis
Returns:
Z-axis value
getGyro
()
Int16_t *
Read gyroscope X, Y, and Z axis
Returns:
pointer to array with X-axis, Y-axis & Z-axis value
getGyroX
()
Number
Returns last gyroscope reading X axis
Returns:
X-axis value
getGyroY
()
Number
Returns last gyroscope reading Y axis
Returns:
Y-axis value
getGyroZ
()
Number
Returns last gyroscope reading Z axis
Returns:
Z-axis value
getTemperature
()
Number
Reads the internal temperature
Returns:
16-bit integer containing the scaled temperature reading
getMotion
()
Int16_t *
Reads the X, Y, and Z axis of both gyroscope and accelerometer
Returns:
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:
axis value
getDirection
()
Number
Returns last shock or tap direction reading
Returns:
direction value
enableShockDetection
-
enable
Turns shock detection notifications on/off
Parameters:
-
enable
Booleanenables/disables notifications
isShockDetected
()
Boolean
Has there been a shock detected?
Returns:
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
Booleanenables/disables notifications
isStepDetected
()
Boolean
Has there been a step detected?
Returns:
true if any unprocessed step notifications are in the queue
getStepCount
()
Number
Gets step count data from queue
Returns:
the total number of steps taken
enableTapDetection
-
enable
Turns tap detection notifications on/off
Parameters:
-
enable
Booleanenables/disables notifications
isTapDetected
()
Boolean
Has there been a tap detected?
Returns:
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
Numberis the length of results buffer
processResponse
()
Processes asyncronous responses returned from Firmata