use this

Dependencies:   mbed

Fork of greenimugetithothot by SGMP Coperations

main.cpp

Committer:
csggreen
Date:
2017-12-07
Revision:
0:92bbf3093a25
Child:
1:44b26709b117

File content as of revision 0:92bbf3093a25:

#include "mbed.h"
#include "zmu9250.h"
#include "math.h"

ZMU9250 axis_Gen;

Serial pc(D1, D0);

float axis_gz, axis_gy, axis_gx;
float axis_az, axis_ay, axis_ax;

int main(){

    while(1){
        wait(0.1);
        axis_Gen.Update();
        axis_ax = axis_Gen.g_ax()*180;
        axis_ay = axis_Gen.g_ay()*180;
        axis_az = axis_Gen.g_az()*180;
        axis_gx = axis_Gen.g_gx()*180;
        axis_gy = axis_Gen.g_gy()*180;
        axis_gz = axis_Gen.g_gz()*180; 
        //pc.printf(" axis_x %f\t axis_y %f\t axis_z %f\n\n\n\r", axis_gx, axis_gy, axis_gz);     
        pc.printf(" axis_x %f\t axis_y %f\t axis_z %f\n\n\n\r", axis_ax, axis_ay, axis_az);
        wait(0.2);     
     }
}