A basic library for the FXOS8700Q combination accelerometer / magnetometer

Dependencies:   MotionSensor

Dependents:   K64F_eCompass_LCD Hello_FXOS8700Q rtos_compass K64F_eCompass ... more

Embed: (wiki syntax)

« Back to documentation index

FXOS8700Q_acc Class Reference

FXOS8700Q_acc Class Reference

MMA8451Q accelerometer example. More...

#include <FXOS8700Q.h>

Public Member Functions

 FXOS8700Q_acc (PinName sda, PinName scl, int addr)
 FXOS8700Q constructor.
 ~FXOS8700Q_acc ()
 FXOS8700Q destructor.

Detailed Description

MMA8451Q accelerometer example.

 #include "mbed.h"
 #include "FXOS8700Q.h"
 int main(void) {
 FXOS8700Q combo( A4, A5, FXOS8700Q_I2C_ADDRESS0);
 PwmOut rled(LED_RED);
 PwmOut gled(LED_GREEN);
 PwmOut bled(LED_BLUE);
     while (true) {       
         rled1.0 - combo(acc.getAccX());
         gled1.0 - combo(acc.getAccY());
         bled1.0 - combo(acc.getAccZ());

Definition at line 70 of file FXOS8700Q.h.

Constructor & Destructor Documentation

FXOS8700Q_acc ( PinName  sda,
PinName  scl,
int  addr 

FXOS8700Q constructor.

sdaSDA pin
sdlSCL pin
addraddr of the I2C peripheral

Definition at line 25 of file FXOS8700Q.cpp.

~FXOS8700Q_acc (  )

FXOS8700Q destructor.

Definition at line 45 of file FXOS8700Q.cpp.