Recently got a new Arduino Nano ESP32. Doing some basic testing. Blink works nicely, and my next step was to create a "chatty" blink which printed "Blink" to Serial every cycle. Nothing printed. Argh. So I modified the sketch (as below) to make a fast blink until Serial returned true, and then continue to make a slow blink in the loop() section. On one of my regular Arduino nano boards, the sketch drops to loop() as expected. But when loaded into the ESP32, I only get the fast blink, and (again) nothing gets printed. BTW pressing reset restarts the program, which drops to fast bink. Nothing appears in the Monitor Window.
I don't think it is the cable as I am using that to load the sketch, and loading works. Double/Triple checked the BAUD rate. Tried a both a faster and slower BAUD rate. I'm assuming successful loading also means the UART is working. Latest version of IDE. Of course, it could be something obvious that I am missing. At this point, I am just one lost hobbyist. Baffled. Suggestions?
Here is the code (with comments minimized):
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(9600);
while(!Serial){ // fast blink
digitalWrite(LED_BUILTIN, HIGH); // on
delay(400);
digitalWrite(LED_BUILTIN, LOW); // off
delay(200);
}
Serial.println("Starting");
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(5000);
digitalWrite(LED_BUILTIN, LOW);
delay(5000);
Serial.println("Blink");
}