![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Pour BOUAZIZ
Dependencies: L3GD20 LSM303DLHC mbed
Fork of minimu-9v2 by
main.cpp@1:7363eeef6409, 2013-11-12 (annotated)
- Committer:
- patsteph
- Date:
- Tue Nov 12 17:26:50 2013 +0000
- Revision:
- 1:7363eeef6409
- Parent:
- 0:4b3d36de811a
pour M S Bouaziz
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bclaus | 0:4b3d36de811a | 1 | #include "mbed.h" |
bclaus | 0:4b3d36de811a | 2 | #include "L3GD20.h" |
bclaus | 0:4b3d36de811a | 3 | #include "LSM303DLHC.h" |
bclaus | 0:4b3d36de811a | 4 | |
bclaus | 0:4b3d36de811a | 5 | L3GD20 gyro(p28, p27); |
bclaus | 0:4b3d36de811a | 6 | Serial debug(USBTX,USBRX); |
bclaus | 0:4b3d36de811a | 7 | LSM303DLHC compass(p28, p27); |
bclaus | 0:4b3d36de811a | 8 | |
bclaus | 0:4b3d36de811a | 9 | |
bclaus | 0:4b3d36de811a | 10 | |
bclaus | 0:4b3d36de811a | 11 | int main() { |
bclaus | 0:4b3d36de811a | 12 | float ax, ay, az; |
bclaus | 0:4b3d36de811a | 13 | float mx, my, mz; |
bclaus | 0:4b3d36de811a | 14 | float gx, gy, gz; |
bclaus | 0:4b3d36de811a | 15 | debug.format(8,Serial::None,1); |
bclaus | 0:4b3d36de811a | 16 | debug.baud(115200); |
bclaus | 0:4b3d36de811a | 17 | |
bclaus | 0:4b3d36de811a | 18 | while(1) { |
bclaus | 0:4b3d36de811a | 19 | |
bclaus | 0:4b3d36de811a | 20 | compass.read(&ax, &ay, &az, &mx, &my, &mz); |
bclaus | 0:4b3d36de811a | 21 | gyro.read(&gx, &gy, &gz); |
patsteph | 1:7363eeef6409 | 22 | 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); |
patsteph | 1:7363eeef6409 | 23 | wait(0.5); |
bclaus | 0:4b3d36de811a | 24 | } |
bclaus | 0:4b3d36de811a | 25 | } |