Skip to content

Commit 4631ce9

Browse files
committed
Multi-Magnetometer support is complete. needs testing. A process function is added to TrajectoryFollower.cpp to fuse all three sensor readings into single x-y-z measurements. I chose to place the function here rather than in the magnetometer library because it seems to fall more under the realm of data or signal processing. This code needs testing.
1 parent 58b33e2 commit 4631ce9

File tree

6 files changed

+324
-157
lines changed

6 files changed

+324
-157
lines changed

lib/IMU/IMU.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ constexpr double GYRO_RESOLUTION = 1.0 / 16.4;
3030

3131
using namespace IMU;
3232

33-
Sensor IMU::IMUs[IMU_COUNT] = {Sensor(IMU_CS, &SPI)};
33+
Sensor IMU::IMUs[IMU_COUNT] = {Sensor(0, &SPI)};
3434

3535
int read_reg(void *context, uint8_t reg, uint8_t *buf, uint32_t len);
3636
int write_reg(void *context, uint8_t reg, const uint8_t *buf, uint32_t len);

lib/fc_pins/fc_pins.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@
99
#define RADIO_TX PC6
1010
#define RADIO_RX PC7
1111
#define PROP1_PIN PA8
12-
#define IMU_CS PA4
12+
13+
const uint32_t IMU_CS[] = {PB5, PB4, PB3};
14+
const uint32_t MAG_CS[] = {PD7, PE7, PE4};

0 commit comments

Comments
 (0)