upm  0.8.0
Sensor/Actuator repository for libmraa (v1.1.1)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions
CurieImu Class Reference

Public Member Functions

 CurieImu (int subplatform_offset=512)
 
 ~CurieImu ()
 
void updateAccel ()
 
void updateGyro ()
 
void updateMotion ()
 
int16_t * getAccel ()
 
int16_t getAccelX ()
 
int16_t getAccelY ()
 
int16_t getAccelZ ()
 
int16_t * getGyro ()
 
int16_t getGyroX ()
 
int16_t getGyroY ()
 
int16_t getGyroZ ()
 
int16_t getTemperature ()
 
int16_t * getMotion ()
 
int16_t getAxis ()
 
int16_t getDirection ()
 
void enableShockDetection (bool enable)
 
bool isShockDetected ()
 
void getNextShock ()
 
void enableStepCounter (bool enable)
 
bool isStepDetected ()
 
int16_t getStepCount ()
 
void enableTapDetection (bool enable)
 
bool isTapDetected ()
 
void getNextTap ()
 
void lock ()
 
void unlock ()
 
void waitForResponse ()
 
void proceed ()
 
void setResults (uint8_t *buf, int length)
 
void processResponse ()
 

Constructor & Destructor Documentation

CurieImu ( int  subplatform_offset = 512)

Instantiates a CurieImu object

Parameters
subplatformoffsetSubplatform offset
~CurieImu ( )

Destructor for CurieImu object

Member Function Documentation

void updateAccel ( )

Updates the latest accelerometer readings by calling Firmata

Here is the call graph for this function:

void updateGyro ( )

Updates the latest gyroscope readings by calling Firmata

Here is the call graph for this function:

void updateMotion ( )

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

Here is the call graph for this function:

int16_t * getAccel ( )

Returns last accelerometer reading X, Y, and Z axis

Returns
pointer to array with X-axis, Y-axis & Z-axis value
int16_t getAccelX ( )

Returns last accelerometer reading X axis

Returns
X-axis value
int16_t getAccelY ( )

Returns last accelerometer reading Y axis

Returns
Y-axis value
int16_t getAccelZ ( )

Returns last accelerometer reading Z axis

Returns
Z-axis value
int16_t * getGyro ( )

Read gyroscope X, Y, and Z axis

Returns
pointer to array with X-axis, Y-axis & Z-axis value
int16_t getGyroX ( )

Returns last gyroscope reading X axis

Returns
X-axis value
int16_t getGyroY ( )

Returns last gyroscope reading Y axis

Returns
Y-axis value
int16_t getGyroZ ( )

Returns last gyroscope reading Z axis

Returns
Z-axis value
int16_t getTemperature ( void  )

Reads the internal temperature

Returns
16-bit integer containing the scaled temperature reading

Here is the call graph for this function:

int16_t * getMotion ( )

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
int16_t getAxis ( )

Returns last shock or tap axis reading

Returns
axis value
int16_t getDirection ( )

Returns last shock or tap direction reading

Returns
direction value
void enableShockDetection ( bool  enable)

Turns shock detection notifications on/off

Parameters
enableenables/disables notifications

Here is the call graph for this function:

bool isShockDetected ( )

Has there been a shock detected?

Returns
true if any unprocessed shock notifications are in the queue
void getNextShock ( )

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

void enableStepCounter ( bool  enable)

Turns step counter notifications on/off

Parameters
enableenables/disables notifications

Here is the call graph for this function:

bool isStepDetected ( )

Has there been a step detected?

Returns
true if any unprocessed step notifications are in the queue
int16_t getStepCount ( )

Gets step count data from queue

Returns
the total number of steps taken
void enableTapDetection ( bool  enable)

Turns tap detection notifications on/off

Parameters
enableenables/disables notifications

Here is the call graph for this function:

bool isTapDetected ( )

Has there been a tap detected?

Returns
true if any unprocessed tap notifications are in the queue
void getNextTap ( )

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

void lock ( )

Locks responses from Firmata

Here is the caller graph for this function:

void unlock ( )

Unlocks responses from Firmata

Here is the caller graph for this function:

void waitForResponse ( )

Wait for a response from Firmata before proceeding

Here is the caller graph for this function:

void proceed ( )

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

void setResults ( uint8_t *  buf,
int  length 
)

Set results being returned from Firmata for processing

Parameters
bufis the buffer
lengthis the length of results buffer
void processResponse ( )

Processes asyncronous responses returned from Firmata


The documentation for this class was generated from the following files: