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.
Dependents: FXOS8700Q MAG3110 MMA8451Q MAG3110 ... more
MotionSensor Class Reference
Motion Sensor Base Class Useful for accessing data in a common way. More...
#include <MotionSensor.h>
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
| virtual void disable | ( | void | ) | const [pure virtual] |
disable the sensors operation
| virtual void enable | ( | void | ) | const [pure virtual] |
Enable the sensor for operation.
| 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
| 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
| 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
| 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
| 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
| 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
| 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
| 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
| 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
Generated on Tue Jul 12 2022 15:29:52 by
1.7.2