A GPIOZero Theramin for Valentine's Day
Thanks to Ben Nuttall, one of the maintainers of the wonderful, GPIOZero library, love is in the air.
Why not serenade your Valentine with Mu, a distance sensor, speaker, Raspberry Pi and some nifty Python code which uses GPIOZero to turn the hardware into a romantic Theramin..?
It’s only four lines of code, thus showing how easy it is to make cool hardware hacks with Mu, Python and GPIOZero:
from gpiozero import TonalBuzzer, DistanceSensor
buzzer = TonalBuzzer(20)
ds = DistanceSensor(14, 26)
buzzer.source = ds
The end result is full of love (for GPIO related shenanigans):