Fort the stop play:
Make this line
var watch;
the very first line in your code and insert after the line in which you turn the LED1 on these lines:
watch = setWatch(function(){ // set the watch for stopping w.stop(); setWatch(play, BTN1, { repeat: false, edge:'xxxxx' , debounce:50}); }, BTN1, { repeat: false, edge:'xxxxx' , debounce:50});
Then add in the stop before the line with w.stop(); this line:
clearWatch(watch); // clears the watch for stopping
@allObjects 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.
Fort the stop play:
Make this line
the very first line in your code and insert after the line in which you turn the LED1 on these lines:
Then add in the stop before the line with w.stop(); this line: