FINAL VERSION

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

FXOS8700CQ.h File Reference

FXOS8700CQ.h File Reference

@ brief FXOS8700CQ Library More...

Go to the source code of this file.


Detailed Description

@ brief FXOS8700CQ Library

Author:
Dr Craig A. Evans (c) University of Leeds, Jan 2017
#include "mbed.h"
#include "FXOS8700CQ.h"

// create object and specifiy pins
FXOS8700CQ device(I2C_SDA,I2C_SCL);

int main()
{
    // call initialisation method
    device.init();

    while (1) {
        
        // poll the sensor and get the values, storing in a struct
        Data values = device.get_values();
        
        // print each struct member over serial
        printf("ax = %f ay = %f az = %f | mx = %f my = %f mz = %f\n"
               ,values.ax, values.ay, values.az
               ,values.mx, values.my, values.mz);
        
        wait(0.5);
    }
}

Definition in file FXOS8700CQ.h.