File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1+ #include " Wire.h"
12#include " motion_fx.h"
23#include " LSM6DSOSensor.h"
34
5+ TwoWire wire (PB7, PB8);
6+
47#define ALGO_FREQ 100U /* Algorithm frequency 100Hz */
58#define ALGO_PERIOD (1000U / ALGO_FREQ) /* Algorithm period [ms] */
69#define MOTION_FX_ENGINE_DELTATIME 0 .01f
@@ -37,7 +40,7 @@ int32_t gyroscope[3];
3740int32_t magnetometer[3 ];
3841int32_t MagOffset[3 ];
3942
40- LSM6DSOSensor AccGyr (&Wire , LSM6DSO_I2C_ADD_L);
43+ LSM6DSOSensor AccGyr (&wire , LSM6DSO_I2C_ADD_L);
4144
4245HardwareTimer *MyTim;
4346
@@ -54,8 +57,8 @@ void setup() {
5457 while (!Serial) yield ();
5558
5659 /* Initialize I2C bus */
57- Wire .begin ();
58- Wire .setClock (400000 );
60+ wire .begin ();
61+ wire .setClock (400000 );
5962
6063 /* Start communication with IMU */
6164 AccGyr.begin ();
@@ -94,7 +97,7 @@ void setup() {
9497 /* Get library version */
9598 LibVersionLen = (int )MotionFX_GetLibVersion (LibVersion);
9699
97- MyTim = new HardwareTimer (TIM3);
100+ MyTim = new HardwareTimer (TIM9); // TIM3
98101 MyTim->setOverflow (ALGO_FREQ, HERTZ_FORMAT);
99102 MyTim->attachInterrupt (fusion_update);
100103 MyTim->resume ();
You can’t perform that action at this time.
0 commit comments