Skip to content

CPP: LED

Leo Vidarte edited this page Mar 7, 2017 · 10 revisions

Download the project

Checkout this PlatformIO project code here

Code

#include <Arduino.h>

// D0 - Internal LED (GPIO16)

void setup ()
{
  pinMode(D0, OUTPUT);
}

void loop ()
{
  // The internal LED turn on when the pin is LOW
  digitalWrite(D0, HIGH);
  delay(1000);
  digitalWrite(D0, LOW);
  delay(1000);
}

Here is the reason why the built in led turn on when Pin 16 is Low :)

Clone this wiki locally