I want to write to the ESP a program that blinks in some random pattern, but I also want to monitor the number of blinks with serial monitor.
For example,
Let x be a random number
For (int i=0;i<x;i++) { digitalWrite(LED_builtin,0); delay(500); digitalWrite(LED_builtin,1); }
Serial.println (x);
How could I do something like this?
It seems that I can only use either the Serial Monitor or the blue LED, and I can't use both.
In most other responses to other people's questions, they suggest wiring up another LED instead. But this isn't the proper solution is it?
From my searches and reading, the Serial Monitor depends on the TX pin (GPIO3). And the LED is on GPIO0 (or GPIO2?). So technically they're independent lines, the TX for the Serial Monitor and the GPIO0 is for the blue LED. But this doesn't seem to be happening this way.
I have also read people suggesting "switch RX/TX". What does this mean exactly? Does it mean I set GPIO3 to input and set GPIO1 to output?
Will the Serial Monitor know to listen to GPIO1 for the serial debugging logs?
Thanks for reading!