
Via the Made With Mu blog:
Thanks to Ben Nuttall, one of the maintainers of the wonderful Raspberry Pi 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 Theremin..?
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):
No comments:
Post a Comment