Thursday, February 14, 2019

Made With Mu: 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):




from Planet Python
via read more

No comments:

Post a Comment

TestDriven.io: Working with Static and Media Files in Django

This article looks at how to work with static and media files in a Django project, locally and in production. from Planet Python via read...