![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Printing gyro measurement results on LCD screen
Dependencies: LCD_DISCO_F429ZI mbed BSP_DISCO_F429ZI GYRO_DISCO_F429ZI
Diff: main.cpp
- Revision:
- 0:44f624c5501e
- Child:
- 4:3e78c8cfba95
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Dec 18 14:39:20 2015 +0000 @@ -0,0 +1,25 @@ +#include "mbed.h" +#include "GYRO_DISCO_F429ZI.h" + +GYRO_DISCO_F429ZI gyro; + +DigitalOut led1(LED1); + +int main() +{ + float GyroBuffer[3]; + + printf("Gyroscope started\n"); + + while(1) { + // Read Gyroscope values + gyro.GetXYZ(GyroBuffer); + // Display values + printf("X = %f\n", GyroBuffer[0]); + printf("Y = %f\n", GyroBuffer[1]); + printf("Z = %f\n", GyroBuffer[2]); + printf("\033[3A"); // Moves cursor up x lines (x value is between [ and A) + led1 = !led1; + wait(1); + } +}