LOW seems to be HIGH

I am using the Feather Huzzah - ESP8266. I am using the onboard red LED [pin 0]. The board is powered through USB. I have done no wiring myself.

I ran the example code blink right out of the box and it seemed to perform perfectly.

Upon greater inspection it seems as though when I digitalWrite() to the onboard LED it turns on when I write LOW and turns off when I write HIGH.

A code example that produces this output is:

void setup() {
  // initialize digital pin LED_BUILTIN as an 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(5000);                       // wait for 5 seconds

This code will turn off the led for one second, then it will turn on for 5 seconds. Is this correct functionality and I’m missing a key concept here or is my board configured incorrectly?

Thank you for your help.

It seems as though this is the correct behavior for many boards to drive the LED by sinking the current at low power.

This link helped: digitalWrite HIGH & LOW inverted · Issue #16 · nodemcu/nodemcu-devkit-v1.0 · GitHub

If the LED is connected to +5v then to the pin, a LOW will turn on the LED. See D1.
If the LED is connected to GND then to the pin, a HIGH will will turn on the LED. See D2.


Thanks LarryD. I believe this to be the case.

Feather Huzzah Schematic

In section D3/D4 of the schematic the diode is pointing away from 3.3V similar to your example with the D1 LED.