Basic example showing how to use the Gyroscope (L3GD20 device) present on DISCO_L476VG board.

Dependencies:   GYRO_DISCO_L476VG BSP_DISCO_L476VG

Revision:
0:5432bdf904f9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Sep 24 06:57:01 2015 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+#include "GYRO_DISCO_L476VG.h"
+
+GYRO_DISCO_L476VG 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);
+    }
+}