Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BSP_DISCO_L476VG COMPASS_DISCO_L476VG LCD_DISCO_L476VG mbed
Fork of DISCO_L476VG_Compass_Lab_6 by
Revision 0:211cb2effe6e, committed 2015-09-22
- Comitter:
- bcostm
- Date:
- Tue Sep 22 14:53:48 2015 +0000
- Child:
- 1:3f3ad7fd259d
- Commit message:
- Initial version.
Changed in this revision
--- /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
