Skip to content

Commit 64d00c6

Browse files
committed
Update Example21: change default I2C address; remove printf's
(printf is not supported on some platforms)
1 parent 9048f8c commit 64d00c6

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

examples/Example21-ResetCheck/Example21-ResetCheck.ino

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
#include "SparkFun_BNO080_Arduino_Library.h" // Click here to get the library: http://librarymanager/All#SparkFun_BNO080
1717

18-
#define BNO08X_ADDR 0x4A
19-
//#define BNO08X_ADDR 0x4B
18+
#define BNO08X_ADDR 0x4B // SparkFun BNO080 Breakout (Qwiic) defaults to 0x4B
19+
//#define BNO08X_ADDR 0x4A // Alternate address if ADR jumper is closed
2020

2121
BNO080 myIMU;
2222

@@ -53,15 +53,20 @@ void loop()
5353
// Check resetReason() for the difference between different resets.
5454
if (myIMU.hasReset()) {
5555
Serial.println(" ------------------ BNO085 has reset. ------------------ ");
56-
Serial.printf(" Reason: %i\n",myIMU.resetReason());
56+
Serial.print(F(" Reason: "));
57+
Serial.println(myIMU.resetReason());
5758
enableReports(); // We'll need to re-enable reports after any reset.
5859
}
5960

6061
//Look for reports from the IMU
6162
if (myIMU.dataAvailable())
6263
{
6364
cyclecount++;
64-
Serial.printf("[%2i] ",cyclecount);
65+
66+
Serial.print(F("["));
67+
if (cyclecount < 10) Serial.print(F("0"));
68+
Serial.print(cyclecount);
69+
Serial.print(F("] "));
6570

6671
float x = myIMU.getGyroX();
6772
float y = myIMU.getGyroY();

0 commit comments

Comments
 (0)