How can you generate white/pink noise on a speaker attached to a Photon?

Hey guys, I have read about the Tone() functions here, which are pretty neat;
https://docs.particle.io/reference/firmware/photon/#tone-

I wish to generate white noise, so that I can make a “hiss” sound from an attached speaker. I don’t want an actual square/sine tone, but white/pink noise.

Can anyone point me in any directions for hints on how I could do this please, I’m a bit lost in the many ways this could be done?

Thanks!

For that I’d use one of the two DAC pins which can generate analog voltages.

But the STM32F2 used on the Photon even features a HW White Noise Generator.


1 Like

Thanks @ScruffR.

Have to admit I have no idea where to start actually programming that! Will take some time reading around and see what examples exist as a starting guide.

If anyone knows any good guides for C++ for this, would really appreciate sharing.

Cheers