Are you using setDeepSleep(1)? Deep sleep turns off the main oscillator (which also turns off PWM), so that could be causing problems? To work around it, just do setDeepSleep(0) whenever you know you'll be driving the piezo, and turn it back on afterwards.
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.
Are you using
setDeepSleep(1)
? Deep sleep turns off the main oscillator (which also turns off PWM), so that could be causing problems? To work around it, just dosetDeepSleep(0)
whenever you know you'll be driving the piezo, and turn it back on afterwards.Otherwise I'm not sure what the issue could be...