Skip to content

Commit 0fb0737

Browse files
committed
Adding the missing _int pinMode for I2C
1 parent 8d2177c commit 0fb0737

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/SparkFun_BNO080_Arduino_Library.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ boolean BNO080::begin(uint8_t deviceAddress, TwoWire &wirePort, uint8_t intPin)
3030
{
3131
_deviceAddress = deviceAddress; //If provided, store the I2C address from user
3232
_i2cPort = &wirePort; //Grab which port the user wants us to use
33-
_int = intPin; //Get the pin that the user wants to use for interrupts. By default, it's NULL and we'll not use it in dataAvailable() function.
33+
_int = intPin; //Get the pin that the user wants to use for interrupts. By default, it's 255 and we'll not use it in dataAvailable() function.
34+
if (_int != 255)
35+
{
36+
pinMode(_int, INPUT_PULLUP);
37+
}
3438

3539
//We expect caller to begin their I2C port, with the speed of their choice external to the library
3640
//But if they forget, we start the hardware here.

0 commit comments

Comments
 (0)