I at the moment trying to print a variable that gets incremented in a ISR.
The serial communication shows a lot of "??" and never once the number i want.. what could be the problem?
speed_profile.cpp
speed_profile.h
main.ino
What am I doing wrong?
Serial.print is not being called from the ISR but The function compute_speed_profile, which compute some init stuff, and then has a thread for it own in which it Serial.print is being called.
the thread has interrupt guards on it.. which should stop interrupt from affecting the serial.print.
The output i receive from the serial monitor is something like this 88xx�8�8�888�88��8�8888�8��
What variables are used in the ISR and in the function? Those variables need to be declared volatile. Otherwise, the compiler assumes that they will not change, and probably throws a lot of your code away.
The baudrate is correct (was also my first guess)
I changed all the member variable of speed profile to volatile, and it still doesn't provide me any useable information.
The only reason why I was only providing snippets and not the whole was to make the problem clearer, and no one would ever dare to read the complete code.
I am using interrupts guards (cli(), and sei()) but i will update the post with the full code.
I just changed the instance, and that didn't work either..