Programmation
/
Lab6_Gyro
Asdf
Diff: main.cpp
- Revision:
- 0:7b5068632811
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Dec 17 17:50:53 2019 +0000 @@ -0,0 +1,22 @@ +#include "mbed.h" +#include "ITG3200.h" + +ITG3200 Gyro(p9, p10, 0xD0, 0xD1); +Serial PC(USBTX,USBRX); + +int main() { + + int X,Y,Z,T; + Gyro.Init(); + PC.printf("Starting system\n\r"); + + while(1) { + + X = Gyro.GetX(); + Y = Gyro.GetY(); + Z = Gyro.GetZ(); + T = Gyro.GetTemp(); + PC.printf("Roll: %i | Pitch: %i | Yaw: %i | Temp: %i\n\r",X,Y,Z,T); + wait(0.5); + } +}