Skip to content

Commit edc5470

Browse files
committed
Version 2.3.6
Added support for the Nano 33 BLE Rev 2
1 parent 92195e2 commit edc5470

File tree

3 files changed

+31
-17
lines changed

3 files changed

+31
-17
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ReefwingAHRS
2-
version=2.3.5
2+
version=2.3.6
33
author=David Such <dsuch@reefwing.com.au>
44
maintainer=David Such <dsuch@reefwing.com.au>
55
sentence=Attitude and Heading Reference System (AHRS) used in the Reefwing Flight Controller.

src/ReefwingAHRS.cpp

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
@copyright Please see the accompanying LICENSE file.
66
77
Code: David Such
8-
Version: 2.3.5
9-
Date: 09/01/25
8+
Version: 2.3.6
9+
Date: 11/02/25
1010
1111
1.0.0 Original Release. 22/02/22
1212
1.1.0 Added NONE fusion option. 25/05/22
@@ -20,6 +20,7 @@
2020
2.3.3 Complementary update enhancements 05/01/25
2121
2.3.4 Corrected spelling for Mahony 09/01/25
2222
2.3.5 Fixed bug in complementaryUpdate 09/01/25
23+
2.3.6 Added support for Nano 33 BLE Rev. 2 11/02/25
2324
2425
2526
Credits: - The C++ code for our quaternion position update
@@ -86,13 +87,14 @@ void imuMeasurementJacobianFunc(const float* state, float* jacobian) {
8687
ReefwingAHRS::ReefwingAHRS() {
8788
_boardTypeStr[0] = "Nano";
8889
_boardTypeStr[1] = "Nano 33 BLE";
89-
_boardTypeStr[2] = "Nano 33 BLE Sense";
90-
_boardTypeStr[3] = "Nano 33 BLE Sense Rev 2";
91-
_boardTypeStr[4] = "Seeed XIAO nRF52840 Sense";
92-
_boardTypeStr[5] = "MKR Portenta H7";
93-
_boardTypeStr[6] = "MKR Vidor 4000";
94-
_boardTypeStr[7] = "Nano 33 IoT";
95-
_boardTypeStr[8] = "Undefined Board Type";
90+
_boardTypeStr[2] = "Nano 33 BLE Rev 2";
91+
_boardTypeStr[3] = "Nano 33 BLE Sense";
92+
_boardTypeStr[4] = "Nano 33 BLE Sense Rev 2";
93+
_boardTypeStr[5] = "Seeed XIAO nRF52840 Sense";
94+
_boardTypeStr[6] = "MKR Portenta H7";
95+
_boardTypeStr[7] = "MKR Vidor 4000";
96+
_boardTypeStr[8] = "Nano 33 IoT";
97+
_boardTypeStr[9] = "Undefined Board Type";
9698
}
9799

98100
void ReefwingAHRS::begin() {
@@ -101,7 +103,7 @@ void ReefwingAHRS::begin() {
101103
setImuType(ImuType::UNKNOWN);
102104
setDOF(DOF::DOF_6);
103105

104-
#if defined(ARDUINO_ARDUINO_NANO33BLE) // Nano 33 BLE found
106+
#if defined(ARDUINO_ARDUINO_NANO33BLE) // Nano 33 BLE found - 4 possible variants
105107

106108
byte error;
107109

@@ -124,9 +126,19 @@ void ReefwingAHRS::begin() {
124126
setDOF(DOF::DOF_9);
125127
}
126128
else {
127-
setBoardType(BoardType::NANO33BLE);
128-
setImuType(ImuType::LSM9DS1);
129-
setDOF(DOF::DOF_9);
129+
Wire1.beginTransmission(LSM9DS1AG_ADDRESS);
130+
error = Wire1.endTransmission();
131+
132+
if (error == 0) {
133+
setBoardType(BoardType::NANO33BLE);
134+
setImuType(ImuType::LSM9DS1);
135+
setDOF(DOF::DOF_9);
136+
}
137+
else {
138+
setBoardType(BoardType::NANO33BLE_R2);
139+
setImuType(ImuType::BMI270_BMM150);
140+
setDOF(DOF::DOF_9);
141+
}
130142
}
131143
}
132144
#elif defined(ARDUINO_AVR_NANO)
@@ -138,7 +150,7 @@ void ReefwingAHRS::begin() {
138150
#elif defined(ARDUINO_SAMD_NANO_33_IOT)
139151
setBoardType(BoardType::NANO33IOT);
140152
#elif defined(BOARD_NAME)
141-
if (strncmp(BOARD_NAME, _boardTypeStr[4], 25) == 0) {
153+
if (strncmp(BOARD_NAME, _boardTypeStr[5], 25) == 0) {
142154
setBoardType(BoardType::XIAO_SENSE);
143155
setImuType(ImuType::LSM6DS3);
144156
setDOF(DOF::DOF_6);

src/ReefwingAHRS.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
@copyright Please see the accompanying LICENSE file.
66
77
Code: David Such
8-
Version: 2.3.5
9-
Date: 09/01/25
8+
Version: 2.3.6
9+
Date: 11/02/25
1010
1111
1.0.0 Original Release. 22/02/22
1212
1.1.0 Added NONE fusion option. 25/05/22
@@ -20,6 +20,7 @@
2020
2.3.3 Complementary update enhancements 05/01/25
2121
2.3.4 Corrected spelling for Mahony 09/01/25
2222
2.3.5 Fixed bug in complementaryUpdate 09/01/25
23+
2.3.6 Added support for Nano 33 BLE Rev. 2 11/02/25
2324
2425
Credits: - The C++ code for our quaternion position update
2526
using the Madgwick Filter is based on the paper,
@@ -59,6 +60,7 @@
5960
enum class BoardType {
6061
NANO = 0,
6162
NANO33BLE,
63+
NANO33BLE_R2,
6264
NANO33BLE_SENSE_R1,
6365
NANO33BLE_SENSE_R2,
6466
XIAO_SENSE,

0 commit comments

Comments
 (0)