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.
Diff: main.cpp
- Revision:
- 19:3ee54f9a56f3
diff -r 07e990a9a3ed -r 3ee54f9a56f3 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Dec 18 06:53:12 2019 +0000
@@ -0,0 +1,13 @@
+#include "imu_driver.hpp"
+
+SPI spi2(PB_15, PB_14, PB_13); //1Mbps default, MOSI MISO SCLK, forIMU
+Serial pc(USBTX, USBRX, 115200); // print debug message
+
+int main()
+{
+ ImuDriver<spi2, PC_4, PB_2, PB_1> imu(ImuExtiRcvAhrsMsg | ImuExtiRcvNormalMsg); //SPI instance, reset, data ready, slave select
+
+ while(true) {
+ pc.printf("% .3f, % .3f, % .3f\n\r", imu.ahrsProcessedData.attitude[0], imu.ahrsProcessedData.attitude[1], imu.ahrsProcessedData.attitude[2]);
+ }
+}