Hi, I am a newbie to Arduino and was trying to just print some random numbers. However, I am not getting anything. Could you please let me know what are the possible solutions?
Hi @Abbassi007. In your screenshot, you have the "Output" view selected instead of the "Serial Monitor" view. So it might be that the numbers are being printed as expected, but you just aren't looking in the right place for them.
Please click on the "Serial Monitor" tab in the bottom panel of the Arduino IDE window and then check to see if you now see the numbers printed:
If you want to communicate with the computer via the "Programming Port", you use the Serial object in your code, as you have done. But if you want to communicate with the computer via the "Native USB Port", then you must instead use the undocumented SerialUSB object in your code.
I see from the screenshot that you are using the "Native USB Port" so you must change all occurrences of Serial in your sketch to SerialUSB.
After doing that, upload the sketch to your board again. Hopefully you will now see the expected output in Serial Monitor.