ESP32 BUILTIN LED just flickering

Gaz0rp
Posts: 6
Joined: Sat Aug 25, 2018 7:07 pm

ESP32 BUILTIN LED just flickering

Postby Gaz0rp » Sun Aug 26, 2018 1:38 pm

Hi,

I opened the default example Blink.ino in Arduino IDE,
just added LED_BUILTIN and those Serial.* to see something happening in the console,
but the ESP32 LED just flickers everytime it is set to HIGH or LOW.
(Serial output is working)

I don't get the LED to stay ON...

Code: Select all

#define LED_BUILTIN 1

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.begin(115200);
}

// the loop function runs over and over again forever
void loop() {
  Serial.printf("LED %d: HIGH\n", LED_BUILTIN);
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  Serial.printf("LED %d: LOW\n", LED_BUILTIN);
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}
(It's a ESP-WROOM-32 if that matters)

ESP_Sprite
Posts: 4234
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 BUILTIN LED just flickering

Postby ESP_Sprite » Mon Aug 27, 2018 2:57 am

Moving this to the Arduino subforum.

From what I can tell, GPIO1 is the TX pin of your serial port; could it be that your digitalWrite does nothing and the printf actually lights the LED? Can you use a different GPIO?

Gaz0rp
Posts: 6
Joined: Sat Aug 25, 2018 7:07 pm

Re: ESP32 BUILTIN LED just flickering

Postby Gaz0rp » Mon Aug 27, 2018 5:23 pm

ESP_Sprite wrote:Moving this to the Arduino subforum.

From what I can tell, GPIO1 is the TX pin of your serial port; could it be that your digitalWrite does nothing and the printf actually lights the LED? Can you use a different GPIO?
Oh indeed, when i just leave the digitalWrite and no Serial.* it does work as intended!
When i just have the Serial.* it does flicker like before...

So i just can't use the internal LED if i use Serial.*
Or is there a trick to use both? Like disabling the tx function?

Who is online

Users browsing this forum: No registered users and 21 guests