My serial monitor will open but it is not displaying anything. I'm using Arduino 1.8.9 and a due. I'm just trying to get it to display something before I continue on other projects, but nothing is showing up.
Follow up: My serial monitor is not working either. They both will open, but both remain completely blank. I've tried both under several different scripts and a handful of different devices. I tried to reinstall the IDE. I'm not really sure what else to do.
I do, yes. I've been writing and running other things all day, and I've been making due by writing to a little OLED display, but I'm at a point where I'm needing the monitor.
For anyone it helps, I didn't realize that the serial monitor would not display anything on my Due when connected to the Native USB. It only functions for me under the programming port. I was on Native because that is the only port that will load any code for me.
You can print to Serial Monitor using the Native USB Port as well. You need to use the correct object name for it though. Serial is for the Programming Port. SerialUSB is for the Native USB Port.
The other tricky thing is that, when using the Native USB Port, the microcontroller will not be reset when you open the Serial Monitor. That means anything printed before you get the Serial Monitor open will be lost. The solution is to add the following line before the first print:
while (!SerialUSB) {}
That will cause your code to hang in an infinite loop until the Serial Monitor is opened. For this reason, you would not want to add that line if you were planning to run your code without a serial connection open.
So if you were using this code with the Programming Port: