@@ -92,17 +92,16 @@ struct bno055_accel_stat_t {
92
92
uint8_t powerMode; // Power mode: Normal - Deep suspend
93
93
};
94
94
95
- // GPIO pins used for controlling the Sensor
96
- #define RESET_PIN 4 // GPIO to reset the BNO055 (RESET pin has to be HIGH for the BNO055 to operate)
97
-
98
- #if defined(__AVR_ATmega32U4__) // Arduino Yun and Leonardo
99
- #define INT_PIN 4 // GPIO to receive the Interrupt from the BNO055 for the Arduino Uno(Interrupt is visible on the INT LED on the Shield)
100
- #elif defined(ARDUINO_ARCH_SAM) // INT_PIN is the interrupt number not the interrupt pin
101
- #define INT_PIN 2
102
- #elif defined(ARDUINO_ARCH_SAMD)
103
- #define INT_PIN 7
95
+ // GPIO to reset the BNO055 (RESET pin has to be HIGH for the BNO055 to operate)
96
+ int RESET_PIN = 7 ; // 7 or 4 are most likely candidate pins
97
+
98
+ // GPIO to receive the Interrupt from the BNO055 (Interrupt is visible on the INT LED on the Shield)
99
+ #if defined(__AVR_ATmega32U4__) // Arduino Yun and Leonardo have I2C shared with pins 2 and 3
100
+ int INT_PIN = 7 ;
101
+ #elif defined(ARDUINO_SAMD)
102
+ int INT_PIN = 7 ; // Older SAMD boards have NMI mapped on pin 2
104
103
#else
105
- # define INT_PIN 0
104
+ int INT_PIN = 2 ;
106
105
#endif
107
106
108
107
#define ENABLE 1 // For use in function parameters
@@ -147,10 +146,13 @@ class NineAxesMotion {
147
146
148
147
/* ******************************************************************************************
149
148
*Description: Function with the bare minimum initialization
150
- *Input Parameters: None
149
+ *Input Parameters:
150
+ unsigned int address: I2C address of the BNO055. Default 0x28
151
+ int int_pin: GPIO to receive the Interrupt from the BNO055 for the Arduino Uno (Interrupt is visible on the INT LED on the Shield)
152
+ int reset_pin: GPIO to reset the BNO055 (RESET pin has to be HIGH for the BNO055 to operate)
151
153
*Return Parameter: None
152
154
*******************************************************************************************/
153
- void initSensor (unsigned int address = 0x28 );
155
+ void initSensor (unsigned int address = 0x28 , int int_pin = 2 , int reset_pin = 7 );
154
156
155
157
/* ******************************************************************************************
156
158
*Description: This function is used to reset the BNO055
0 commit comments