I can't actually see how much power that amp draws, but the IO pins can supply 20mA - I think it'd be fine for a normal opamp, but if you're powering a speaker or something with it you may well hit trouble.
You could use a transistor or FET to switch the power (or even one of those relay modules). Personally I prefer FETs as they generally switch more power and usually only require one resistor.
There's actually a page on them here - including how to wire them up using Espruino's proto area: http://www.espruino.com/mosfets
You'd probably want a PFET (something that will supply a 3.3 or 5v output when needed, rather than an N-channel FET which shorts things to ground.
Also, I'm not sure what you do when you stop playing the waveform, but if you set the output to an input afterwards you'd get a lot more noise than in you just did analogWrite(.., 0.5).
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.
I can't actually see how much power that amp draws, but the IO pins can supply 20mA - I think it'd be fine for a normal opamp, but if you're powering a speaker or something with it you may well hit trouble.
You could use a transistor or FET to switch the power (or even one of those relay modules). Personally I prefer FETs as they generally switch more power and usually only require one resistor.
There's actually a page on them here - including how to wire them up using Espruino's proto area: http://www.espruino.com/mosfets
You'd probably want a PFET (something that will supply a 3.3 or 5v output when needed, rather than an N-channel FET which shorts things to ground.
Also, I'm not sure what you do when you stop playing the waveform, but if you set the output to an input afterwards you'd get a lot more noise than in you just did
analogWrite(.., 0.5)
.Hope that helps!