@psc1988 have o look at this led sample
https://www.espruino.com/Flashing+Lights
it is also possible to use toggle()
https://www.espruino.com/Reference#l_Pin_toggle
there are more samples in the forum - use seach in section conversation.
@MaBe started
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.
@psc1988 have o look at this led sample
https://www.espruino.com/Flashing+Lights
it is also possible to use toggle()
https://www.espruino.com/Reference#l_Pin_toggle
there are more samples in the forum - use seach in section conversation.