Basic example showing how to use the Compass (LSM303 device with Accelerometer and Magnetometer) present on DISCO_L476VG board.

Dependencies:   BSP_DISCO_L476VG COMPASS_DISCO_L476VG

Files at this revision

API Documentation at this revision

Comitter:
jeromecoutant
Date:
Tue Sep 24 18:05:30 2019 +0200
Parent:
3:03a58ed7899a
Commit message:
Update with STM32Cube_FW_L4_V1.14.0

Changed in this revision

BSP_DISCO_L476VG.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show diff for this revision Revisions of this file
diff -r 03a58ed7899a -r 875e95338f6d BSP_DISCO_L476VG.lib
--- a/BSP_DISCO_L476VG.lib	Thu Jul 06 09:02:32 2017 +0000
+++ b/BSP_DISCO_L476VG.lib	Tue Sep 24 18:05:30 2019 +0200
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/ST/code/BSP_DISCO_L476VG/#917af0ca86df
+https://developer.mbed.org/teams/ST/code/BSP_DISCO_L476VG/#4943b15cce9f
diff -r 03a58ed7899a -r 875e95338f6d main.cpp
--- a/main.cpp	Thu Jul 06 09:02:32 2017 +0000
+++ b/main.cpp	Tue Sep 24 18:05:30 2019 +0200
@@ -10,7 +10,7 @@
     int16_t MagBuffer[3];
     int16_t AccBuffer[3];
   
-    printf("Compass started\n");
+    printf("Compass started (LD5 should blink)\n");
   
     while(1) {
       
@@ -27,6 +27,6 @@
         printf("\033[6A"); // Moves cursor up x lines (x value is between [ and A)
       
         led1 = !led1;
-        wait(1);
+        ThisThread::sleep_for(1000);
     }
 }
diff -r 03a58ed7899a -r 875e95338f6d mbed-os.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Tue Sep 24 18:05:30 2019 +0200
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#b81aeff1a3e171c6421984faa2cc18d0e35746c0
diff -r 03a58ed7899a -r 875e95338f6d mbed.bld
--- a/mbed.bld	Thu Jul 06 09:02:32 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-https://mbed.org/users/mbed_official/code/mbed/builds/64910690c574
\ No newline at end of file