Just add const LED1 = D2 or const LED1 = NodeMCU.D4; //(pin2 of ESP8266) to get the build-in LED blinking.
And actually you don't need the variables LED1 and on as you can simply call D2.toggle() or NodeMCU.D4.toggle() to toggle the pin D2/build-in LED:
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Just add
const LED1 = D2
orconst LED1 = NodeMCU.D4; //(pin2 of ESP8266)
to get the build-in LED blinking.And actually you don't need the variables
LED1
andon
as you can simply callD2.toggle()
orNodeMCU.D4.toggle()
to toggle the pin D2/build-in LED:To stop the blinking call
clearInterval()
.