Henry Triff / Mbed 2 deprecated ELEC2645_Project_el18ht

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.

Data Structures

struct  Point_2D
 2D point Struct More...
struct  Line_2D
 2D line Struct More...
struct  Square_2D
 2D square Struct More...
struct  Triangle_2D
 2D triangle Struct More...
struct  Map_Data
 2D Map data Struct More...
struct  Time
 Time Struct. More...
struct  Gyro_Data
 Gyro Data Struct. More...

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.