Yes, this code does work.
Serial.print works as expected after resetting the ESP32 S2.
But I really had to take care about the GPIOs being used for other purposes. I used the code developed for other ESP32 boards so I used GPIOs 22, 25, 26 and 27 as outputs. All of them prevented the USB port from appearing at runtime (after reset).
... and CDC on boot enabled in Tools menu, of course.
You have marked post #18 as a solution which says that Serial1.print() is working and not Serial.print(). It contradicts with your post #21; where, you are claiming that Serial.print() works; so, post #18 does not stand as a solution – correct?
I'm sorry for the confusion I caused. I'm just repeating everything here to make it clear.
#define LED 15
void setup () {
delay (1000);
Serial.begin (115200);
delay (1000);
pinMode (LED, OUTPUT);
Serial.println ("Whatever");
}
void loop () {
digitalWrite (LED, HIGH);
delay (1000);
digitalWrite (LED, LOW);
delay (1000);
Serial.println ("Hello");
}
Whatever
Hello
Hello
Hello
Hello
Your sketch of post #24 does not work for me -- I mean no text message has appeared on Serial Monitor.
Would be glad to see the picture of your setup and the list of steps (in sequence) that you have followed to make the sketch of post #24 working.
These are my Arduino settings for uploading the sketch #24:
After uploading the sketch and pressing the reset button on ESP32 S2 I get:
and the LED is blinking.
What version of IDE you are using?
Why is my Tools' Menu of IDE 2.2.1 not same yours? There is no such thing as Upload Mode: UART0?
Please, visit this thread. Post #18 of this thread cannot be the solution to your problem.
Which borad is different --?
I selected ESP32S2 Dev Module.
... and you selected ESP32 Dev Module. The board selected has influence on the Tools menu.
IDE 2.2.1
Borad selected: ESP32S2 Dev Module
USB CDC On Boot: "Enabled"
Upload Mode: "UART0"
Sketch is compiled/uploaded
Serial MOnitor Output along with LED blinking:
11:26:01.625 -> Hello
11:26:03.614 -> Hello
11:26:05.619 -> Hello
11:26:07.631 -> Hello
11:26:09.629 -> Hello
Apparently, it is IDE 2.2.1 that works and NOT IDE 1.8.19.
Thank you so much for help!
Thank you. This worked perfectly for me too.