you should be able override it just like that var LED1 = NodeMCU.D2; to put NodeMCU.D2 on LED1 (or just any other (var) name). Since it is a pin, it 'understands' .set() and .reset() and all other pin related 'methods' as documented in https://www.espruino.com/Reference#Pin documentation. Since Espruino boards have the LEDs known and (may) preset pin mode, you may need to do that too with the assignment, such as pinMode(NodeMCU.D2,"output"). --- Let us know if it works... your board's built-in LWD - if there is one on any of the pins - or to which pin you will connect the LED w/ resistor - will define the code detail.
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.
@user130486,
you should be able override it just like that
var LED1 = NodeMCU.D2;
to putNodeMCU.D2
onLED1
(or just any other (var) name). Since it is a pin, it 'understands'.set()
and.reset()
and all other pin related 'methods' as documented in https://www.espruino.com/Reference#Pin documentation. Since Espruino boards have the LEDs known and (may) preset pin mode, you may need to do that too with the assignment, such aspinMode(NodeMCU.D2,"output")
. --- Let us know if it works... your board's built-in LWD - if there is one on any of the pins - or to which pin you will connect the LED w/ resistor - will define the code detail.