the internal LED is attached to PIN8. Unfortunately i cant get any of my three boards to work with the Blink Sketch. All other pins described on the picture work fine. I only use the USB Connector as power source.
Does somebody have an idea why the LED isnt working?
1. This is the location of onBoard LED (Blue color) on my ESP32C3 Super Mini Board (Fig-1). The LED is found connected at GPIO-8 as proved by the sketch of Step-2.
Figure-11:
2. Uplaod the following sketch with these parameters in IDE 2.2.1.
IDE 2.2.1
Board: "LOLIN C3 Mini"
Port: "COM6" (TAMC Termod S3)
USB CDC on Boot: "Enabled"
Upload Speed: 921600
#define LED_BUILTIN 8
char myData[20];
void setup()
{
Serial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop()
{
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000);
byte n = Serial.available();
if (n != 0)
{
byte m = Serial.readBytesUntil('\n', myData, sizeof (myData)-1);
myData[m] = '\0';
Serial.println(myData);
}
Serial.println("Hello");
}
3. Check that onBoard LED is blinking at 2-sec interval. 4. Check that you can communicate with the InputBox/OutputBox of the Serial Monitor.
Note:
Use DVM in sond mode to check the coninuity between cathode-pin of the onBoard LED and every GPIO of the Board to find which GPIO is actually connected with the onBoard LED of your Board.
I think i`ve found the reason for not working. It seems, that the LED is soldered in the wrong direction. On all of my three boards a little arrow on the LED points to the pins.
On this photo
I'm working with an ESP32-C3 Super Mini, and I've noticed an interesting behavior with the onboard LED. The LED is connected to GPIO 8, and I observed that it turns off when I set the GPIO to High and turns on when I set it to Low.
This inverted logic seems a common design choice in ESP32 boards, particularly for onboard LEDs. It allows the microcontroller to sink current rather than source it, which can be more efficient and provides better control over the LED's brightness.
GolamMostafa´s code works perfectly for me, but I have to invert High/Low as I mentioned.
Often the LEDs are attached to so called strapping pins which condition the boot behaviour and these pins generally have to be high at boot time so they [the LEDs] are wired on the high side, that is LOW = ON.
It works if you set the LED to off. Basically off = on and on = off. Weird. The only reason I didn't return mine is because I thought "maybe what if I set it to off" and it actually turned on.
I am using "off" and "on" because I am programming in MicroPython, I do not completely understand C++ yet. By "off = on" and "on = off" I mean "off is HIGH" and "on is LOW".
But you are not setting the LED to off by setting its pin to LOW. Because of the way this LED is connected LOW is on and HIGH is off
In a similar vein, if you arrange a switch to take a pin LOW when closed and use INPUT_PULLUP in pinMode() then you can determine that the switch is closed by detecting the LOW state on the pin. I assume that you think that is wrong too
Apologies for my lack of clarity. I am at the core a MicroPython user thus I did not exactly understand the LOWs and HIGHs. I've updated my findings to make more sense.
Interesting...
I have done a few PCB designs for a few projects, but never have I seen an LED without a dedicated ground pin like that. I've only seen GPIO --> LED --> Resistor --> GND or GPIO --> Resistor --> LED --> GND.
In this case, I believe the GPIO acts like a ground since it is basically set to 0V when in the LOW state? But it has a voltage by default, thus not completing the circuit in the HIGH state?
Humans tend to think of HIGH meaning on and LOW meaning off but that has no meaning to the LED. It turns on when current flows through it whatever the source. All that matters is that there is a source of current