Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By accloginsell
#73131 Hi all,



just need a simple script
Once NODEMCU receive power it should power one GPIO 3 Times with a little hold of 1 Second between

can you help me whats wrong with this?

After flashing nothing is working
Code: Select all#define LED 4
void setup() {
  // put your setup code here, to run once:
 pinMode(LED, OUTPUT); // Port aus Ausgang schalten
 delay(3000); //1 Sek Pause
 digitalWrite(LED, LOW); //Led port ausschalten
 delay(300); //1 Sek Pause
 digitalWrite(LED, HIGH); //Led port einschlaten
 delay(1000);
 digitalWrite(LED, LOW); //Led port ausschalten
 delay(300); //1 Sek Pause
 digitalWrite(LED, HIGH); //Led port einschlaten
 delay(1000);
 digitalWrite(LED, LOW); //Led port ausschalten
 delay(300); //1 Sek Pause
 digitalWrite(LED, HIGH); //Led port einschlaten
}

void loop() {
  // put your main code here, to run repeatedly:

}


Thanks for your help!!

Nico
User avatar
By schufti
#73147 Hi,
if you want to toggle gpio3 why do you define LED as 4?
And you wouldn't want to toggle gpio3 (uart RX).

you wouldn't need the first delay(1000) after defining pin as output ... it just gives you a delay where nothing happens.

take care that on nodemcu gpio <> pinname (see attached graphic).
you can use Dx pinnames when you set your board to nodemcu, but not otherway round (use Dx when set to generic ESP). Best is to allways use plain (gpio-) number.
You do not have the required permissions to view the files attached to this post.