![](/media/cache/group/ST_logo_2020_blue_V_cmyk.jpg.50x50_q85.jpg)
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
Diff: main.cpp
- Revision:
- 4:875e95338f6d
- Parent:
- 0:211cb2effe6e
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); } }