reads gyroscope values

Dependencies:   L3GD20 mbed

main.cpp

Committer:
mitchelljones
Date:
2015-09-18
Revision:
0:637603e82d47

File content as of revision 0:637603e82d47:

#include "mbed.h"
#include "L3GD20.h"
 
Serial pc(USBTX, USBRX);
L3GD20 gyro(p28, p27);
float gx;
float gy;
float gz;
int x;
 
int main()
{
  
    while(1) {
      gyro.read(&gx,&gy,&gz);
      x = (int)gx*1000;
      pc.printf("%d",x);
    
        wait(0.01);
       
 
    }
 
}