The MagPi - February 2020

(Greg DeLong) #1

GPIO MUSIC BOX


Build a very custom button to
prank your friends

We could very easily lie here, without any
reservations, that the reason we like this
tutorial is because of the ingenious, DIY
button that makes up a major part of it.
However, it’s mainly just an excuse to make a
digital whoopee cushion, which is hilarious.
To be fair, we do also like the very DIY button
made out of paper plates and tin foil and
clips, and it’s a great way to learn how you can
bodge together your own buttons and sensors
and such, while also pranking your parents,
siblings, friends, roommates, or even your boss.
magpi.cc/whoopi

WHOOPI CUSHION


QUICK


PHYSICAL PROJECTS


Bring your code into the real world


Coding is fun, but have you ever used Python
code to interact with real-life objects? Using a
simple push-button hooked up to the GPIO pins of
a Raspberry Pi, you can control the way code runs.
In this project, you’ll learn how to program with
a push-button so that specific button presses will
play different sounds.
This project makes use of both GPIO Zero – a
library specifically created to make accessing
components on GPIO easy – and Pygame, which can
be used for programming video games in Python.
magpi.cc/gpiomusicbox

Learn how buttons and other input
components work with Raspberry Pi

FEATURE


60 magpi.cc New year, new projects!

Free download pdf