Skip to content

MicroPython: LED

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

from machine import Pin
from time import sleep

# GPIO16 (D0) is the internal LED for NodeMCU
led = Pin(16, Pin.OUT)

# The internal LED turn on when the pin is LOW
while True:
    led.high()
    sleep(1)
    led.low()
    sleep(1)

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

Clone this wiki locally