I'm trying to debug a sketch that I have mostly copied from another source. It is structured such that the void loop is very short and calls various other functions that are defined elsewhere in the sketch.
I want to print a variable that is defined in one of these functions. However, if I include a "Serial.print(variable)" within the loop, I get the error '"variable was not declared in this scope". On the other hand, if I include the Serial.print call within the function where the variable is created, nothing happens.
How can I get around this?
Thanks in advance.