![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Pour BOUAZIZ
Dependencies: L3GD20 LSM303DLHC mbed
Fork of minimu-9v2 by
main.cpp
- Committer:
- patsteph
- Date:
- 2013-11-12
- Revision:
- 1:7363eeef6409
- Parent:
- 0:4b3d36de811a
File content as of revision 1:7363eeef6409:
#include "mbed.h" #include "L3GD20.h" #include "LSM303DLHC.h" L3GD20 gyro(p28, p27); Serial debug(USBTX,USBRX); LSM303DLHC compass(p28, p27); int main() { float ax, ay, az; float mx, my, mz; float gx, gy, gz; debug.format(8,Serial::None,1); debug.baud(115200); while(1) { compass.read(&ax, &ay, &az, &mx, &my, &mz); gyro.read(&gx, &gy, &gz); debug.printf("a %.4f %.4f %.4f m %.4f %.4f %.4f g %.4f %.4f %.4f\n\r",ax,ay,az,mx,my,mz,gx,gy,gz); wait(0.5); } }