-
• #2
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...
-
• #3
Yes - deep sleep is set - will try that !
I have a little piezo I am turning on by
analogWrite(A5, 0.5, { freq: f } );
While I am debugging and connected to USB it works fine. When I disconnect USB and leave it to run on battery it sounds but does a funny chirp - I assume the PWM is getting messed up somehow.
I dont have a scope to check what is going on - any ideas ? Anything to do with A5 ?