Serial monitor either not outputting anything or outputting gibberish

Edited to Clarify: The bug referenced below does not apply the the Arduino Nano, so it wouldn't explain the behavior observed by the OP. Nonetheless, I am leaving this comment up, in case someone with an affected board (Arduino Uno, Arduino Uno Mini, Arduino Mega) comes across this thread by forum search.


What you're observing could be due to a known bug:

 

The available work-arounds if you are affected by this bug are to do one of the following:

  • Insert a 1–2 second delay immediately after the Serial.begin() command in your code.
  • After uploading your code, quickly press the board's Reset button once.