Jakob Palmiter / Mbed 2 deprecated Final_project_Compass

Dependencies:   BSP_DISCO_L476VG COMPASS_DISCO_L476VG LCD_DISCO_L476VG mbed

Fork of DISCO_L476VG_Compass_Lab_6 by Jakob Palmiter

Files at this revision

API Documentation at this revision

Comitter:
bcostm
Date:
Tue Sep 22 14:53:48 2015 +0000
Child:
1:3f3ad7fd259d
Commit message:
Initial version.

Changed in this revision

BSP_DISCO_L476VG.lib Show annotated file Show diff for this revision Revisions of this file
COMPASS_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.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BSP_DISCO_L476VG.lib	Tue Sep 22 14:53:48 2015 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/teams/ST/code/BSP_DISCO_L476VG/#792b4cbebcb6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/COMPASS_DISCO_L476VG.lib	Tue Sep 22 14:53:48 2015 +0000
@@ -0,0 +1,1 @@
+COMPASS_DISCO_L476VG#6508fa5521e0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Sep 22 14:53:48 2015 +0000
@@ -0,0 +1,32 @@
+#include "mbed.h"
+#include "COMPASS_DISCO_L476VG.h"
+
+COMPASS_DISCO_L476VG compass;
+
+DigitalOut led1(LED1);
+
+int main()
+{
+    int16_t MagBuffer[3];
+    int16_t AccBuffer[3];
+  
+    printf("Compass started\n");
+  
+    while(1) {
+      
+        // Read acceleremoter and magnetometer values
+        compass.AccGetXYZ(AccBuffer);
+        compass.MagGetXYZ(MagBuffer);
+        // Display values      
+        printf("Acc X = %d\n", AccBuffer[0]);
+        printf("Acc Y = %d\n", AccBuffer[1]);
+        printf("Acc Z = %d\n", AccBuffer[2]);
+        printf("Mag X = %d\n", MagBuffer[0]);
+        printf("Mag Y = %d\n", MagBuffer[1]);
+        printf("Mag Z = %d\n", MagBuffer[2]);
+        printf("\033[6A"); // Moves cursor up x lines (x value is between [ and A)
+      
+        led1 = !led1;
+        wait(1);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Sep 22 14:53:48 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4f6c30876dfa
\ No newline at end of file