Quantcast
Channel: Planet Python
Viewing all articles
Browse latest Browse all 23381

Made With Mu: A GPIOZero Theramin for Valentine’s Day

$
0
0

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):



Viewing all articles
Browse latest Browse all 23381

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>