Cant get rid of DEBUG message

I have the pretty simple code (end of post) and every time I run it, it shows on my Serial this:

Checking hardware revision...
Revision @ user[16][6] = A5
Resetting memory bank selection to 0...

Looking at "MPU6050_6Axis_MotionApps20.h" code, it checks for the DEBUG to display those messages. So I tried adding the line below to the beginning, middle, end... of the code (end of post) and it does not matter, it always shows the debug information

#undef DEBUG

So how do I get rid of the debug information?

#include "MPU6050_6Axis_MotionApps20.h"
MPU6050 mpu;


void setup() {
  
  Serial.begin(115200);
  
  Wire.begin();
  Wire.setClock(400000);
  mpu.initialize();
  
  mpu.dmpInitialize();

}

void loop() {

}

It's not a DEBUG print

it is printed in the code regardless - remark out these lines

Serial.print(F("Revision @ user[16][6] = "));
Serial.println(readMemoryByte(), HEX);
Serial.println(F("Resetting memory bank selection to 0..."));
Serial.println(F("Checking hardware revision..."));

in that file (around line 294)

Indeed you are right!!! I thought it was because of the DEBUG being defined wrongly somewhere. Thank you!

No problem, I just looked a the file, and searched for one of the lines, was abvious when found. :slight_smile:

@missdrew I also did the same as you but right at the top of that file I see that there was a DEBUG being defined and inside it it would set lots of DEBUG_PRINTLN... so I didnt even take a look at the rest of the file, I assume that any message being shown was because of the DEBUG being set somewhere in the code that I couldnt find (I CTRL+F all occurences and there was no DEBUG ser anywhere). Thank you anyway, helped me a lot!

Jeff (the maintaner of the library) just sent a commit fixing the bug I reported here on this thread. Check it here -> Fix leftover debug output to use debug macros · jrowberg/i2cdevlib@10bcf2b · GitHub

That's why it was not so obvious to me :slight_smile:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.