and thanks so much for all the great info in this forum, I went through a couple of threads to get me started. However, I am not getting why my ESP is running too slow or what I did wrong so far. I programmed the BlinkWithoutDelay example sketch and added some lines for Serial output:
int ledState = LOW;
unsigned long previousMillis = 0;
const long interval = 1000;
unsigned long steps=0;
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(9600);
}
void loop() {
steps++;
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval) {
previousMillis = currentMillis;
Serial.print("Steps:");
Serial.println(steps);
steps=0;
if (ledState == LOW) {
Serial.print("Off:");
Serial.println(millis());
ledState = HIGH; // Note that this switches the LED *off*
} else {
ledState = LOW; // Note that this switches the LED *on*
Serial.print("On:");
Serial.println(millis());
}
digitalWrite(LED_BUILTIN, ledState);
}
}
What I am getting now is the following:
Steps:182039
On:576083
Steps:182144
Off:577083
Steps:181821
On:578083
Steps:181987
Off:579083
As expected the LED is toggled every second and in between there are 1000 Milliseconds. But the steps are like 182000 per second so the main loop is executed with like 182 kHz. Where is this coming from?
More info on the hardware: I bought this board (https://www.amazon.com/gp/product/B010N1SPRK/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1) and followed the steps written on that page. Also I performed step6:
6. Download and run the 32 bit flasher exe at Github(Search for nodemcu/nodemcu-flasher/tree/master/ at Github) github.com/nodemcu/nodemcu-flasher/tree/master/Win32/Release Or download and run the 64 bit flasher exe at: github.com/nodemcu/nodemcu-flasher/tree/master/Win64/Release
I first flashed the board with the default settings from the nodemcu-flasher. Are all of these settings overwritten by flashing with Arduino IDE?
Thank you so much for the help, I really appreciate that.