I'm debugging a rubbish piece of code I wrote, for practice. I've got an intiger variable 'ledNum', and I want to somehow display it as it changes over time on my computer shows me what number it's on..
Such a daft question, but I've looked for 20 mins and not found the answer. It'd be such a useful thing to know, so if anyone does know it, it'd be so welcome.
Have your cable connected from your computer to the Arduino like you do for uploading a new program.
Add Serial.begin(57600); in your setup area and then add
Serial.print(ledNum); in your loop.
After uploading the program open your serial monitor window (make sure this is also set to 57600) and you will see the variable there.