-
Notifications
You must be signed in to change notification settings - Fork 40
MicroPython: LED
Leo Vidarte edited this page Mar 14, 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 :)
def led_toggle():
led.value(not led.value())
ESP8266 NodeMCU Workshop - 2017