Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
MotionSensor Class Reference
Motion Sensor Base Class Useful for accessing data in a common way. More...
#include <MotionSensor.h>
Inherited by FXOS8700Q.
Public Member Functions | |
| virtual void | enable (void) const =0 |
| Enable the sensor for operation. | |
| virtual void | disable (void) const =0 |
| disable the sensors operation | |
| virtual uint32_t | sampleRate (uint32_t frequency) const =0 |
| Set the sensor sample rate. | |
| virtual uint32_t | dataReady (void) const =0 |
| Tells of new data is ready. | |
| virtual int16_t | getX (int16_t &x) const =0 |
| Get the x data in counts. | |
| virtual int16_t | getY (int16_t &y) const =0 |
| Get the y data in counts. | |
| virtual int16_t | getZ (int16_t &z) const =0 |
| Get the z data in counts. | |
| virtual float | getX (float &x) const =0 |
| Get the x data in units. | |
| virtual float | getY (float &y) const =0 |
| Get the y data in units. | |
| virtual float | getZ (float &z) const =0 |
| Get the z data in units. | |
| virtual void | getAxis (motion_data_counts_t &xyz) const =0 |
| Get the x,y,z data in counts. | |
| virtual void | getAxis (motion_data_units_t &xyz) const =0 |
| Get the x,y,z data in units. | |
Detailed Description
Motion Sensor Base Class Useful for accessing data in a common way.
Definition at line 42 of file MotionSensor.h.
Member Function Documentation
| virtual uint32_t dataReady | ( | void | ) | const [pure virtual] |
Tells of new data is ready.
- Returns:
- The amount of data samples ready to be read from a device
Implemented in FXOS8700Q.
| virtual void disable | ( | void | ) | const [pure virtual] |
disable the sensors operation
Implemented in FXOS8700Q.
| virtual void enable | ( | void | ) | const [pure virtual] |
Enable the sensor for operation.
Implemented in FXOS8700Q.
| virtual void getAxis | ( | motion_data_counts_t & | xyz ) | const [pure virtual] |
Get the x,y,z data in counts.
- Parameters:
-
xyz A referene to the variable to put the data in, 0 denotes not used
Implemented in FXOS8700QAccelerometer, and FXOS8700QMagnetometer.
| virtual void getAxis | ( | motion_data_units_t & | xyz ) | const [pure virtual] |
Get the x,y,z data in units.
- Parameters:
-
xyz A referene to the variable to put the data in, 0 denotes not used
Implemented in FXOS8700QAccelerometer, and FXOS8700QMagnetometer.
| virtual float getX | ( | float & | x ) | const [pure virtual] |
Get the x data in units.
- Parameters:
-
x A referene to the variable to put the data in, 0 denotes not used
- Returns:
- The x data in units
Implemented in FXOS8700QAccelerometer, and FXOS8700QMagnetometer.
| virtual int16_t getX | ( | int16_t & | x ) | const [pure virtual] |
Get the x data in counts.
- Parameters:
-
x A referene to the variable to put the data in, 0 denotes not used
- Returns:
- The x data in counts
Implemented in FXOS8700QAccelerometer, and FXOS8700QMagnetometer.
| virtual float getY | ( | float & | y ) | const [pure virtual] |
Get the y data in units.
- Parameters:
-
y A referene to the variable to put the data in, 0 denotes not used
- Returns:
- The y data in units
Implemented in FXOS8700QAccelerometer, and FXOS8700QMagnetometer.
| virtual int16_t getY | ( | int16_t & | y ) | const [pure virtual] |
Get the y data in counts.
- Parameters:
-
y A referene to the variable to put the data in, 0 denotes not used
- Returns:
- The y data in counts
Implemented in FXOS8700QAccelerometer, and FXOS8700QMagnetometer.
| virtual int16_t getZ | ( | int16_t & | z ) | const [pure virtual] |
Get the z data in counts.
- Parameters:
-
z A referene to the variable to put the data in, 0 denotes not used
- Returns:
- The z data in counts
Implemented in FXOS8700QAccelerometer, and FXOS8700QMagnetometer.
| virtual float getZ | ( | float & | z ) | const [pure virtual] |
Get the z data in units.
- Parameters:
-
z A referene to the variable to put the data in, 0 denotes not used
- Returns:
- The z data in units
Implemented in FXOS8700QAccelerometer, and FXOS8700QMagnetometer.
| virtual uint32_t sampleRate | ( | uint32_t | frequency ) | const [pure virtual] |
Set the sensor sample rate.
- Parameters:
-
frequency The desires sample frequency
- Returns:
- The amount of error in Hz between desired and actual frequency
Implemented in FXOS8700Q.
Generated on Wed Jul 13 2022 01:33:25 by
1.7.2