INCREDIBLE
RASPBERRY PI The terminal will
PROJECTS
help you, if you know
how to ask
POWER UP
The safest ways
to power your Pi
HOT STUFF!
Build an LED
thermometer
AMAZING ART
WITH PYTHON
Use a DJ controller
to mix a masterpiece
PAGE 2
WELCOME TO
6
THE OFFICIAL
MAGAZINE
igital making is fun, but its also
D incredibly important. Whether youre
building something from scratch,
or taking an existing gadget and stripping it
down to add your own touch of magic, its vital
that we think about how things actually work.
Whether we like it or not, we live in a world
where small impenetrable black monoliths
SEE PAGE 26 FOR DETAILS
deliver our entertainment and information.
We dont have to think about how they work
and their designers dont want us to.
Digital making with the Raspberry Pi is the THIS MONTH:
perfect antidote, and weve put together a
selection of easy and intermediate projects
for you to try in our cover feature starting
14 GET STARTED WITH DIGITAL MAKING
The perfect cure for a rainy weekend at home!
on page 14. Elsewhere this issue were also
building some great devices, including an LED
thermometer, a gadget that turns Python code
34 COMMAND LINE HELP & SUPPORT
Learn how to get the command line to help you help yourself
into art, and a simple reactions game, among
other things. 38 HOW TO POWER YOUR PROJECTS
Happy making! The best (and safest) ways to power your Raspberry Pi project
This magazine is printed on paper sourced from The MagPi magazine is published by Raspberry Pi (Trading) Ltd., 30 Station Road, Cambridge, CB1 2JH. The publisher,
sustainable forests and the printer operates an editor, and contributors accept no responsibility in respect of any omissions or errors relating to goods, products or services
environmental management system which has referred to or advertised in the magazine. Except where otherwise noted, content in this magazine is licensed under a
been assessed as conforming to ISO 14001. Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0). ISSN: 2051-9982.
INCREDIBLE
PROJECTS
> MAKE DJ TURNTABLE ART 52
Use a DJ Hero turntable to express yourself in pictures
Raspberry Pi 2B - 21%
Raspberry Pi B+ - 21%
Raspberry Pi B - 21%
Raspberry Pi Zero - 4%
Raspberry Pi A+ - 3%
Raspberry Pi A - 1%
Raspberry Pi Zero W - 1%
94
CAMBRIDGE THEME
RASPBERRY PI OS GALLERY
Which Raspberry Pi operating system suits your needs? 60 Get a taste of home with the
13
Check our definitive guide... new Cambridge desktop theme
COMMUNITY
> THIS MONTH IN PI 80
What else happened in the world of Pi?
PI MINI MINT
This Raspberry Pi with a screen is crammed into a mint tin
> EVENTS
What Jams and Code Clubs can you go to this month?
> LETTERS
90
92
We answer your letters on Raspberry Pi and the mag
PI FILM CAPTURE 30
Using a Camera Module to digitise film
REVIEWS
reels, one frame at a time
> RAINBOW HAT 72
FLY AI 32 > WD COMPUTE CENTRE 74
Raspberry Pi plays God with a colony > JUSTBOOM DAC HAT 75
of flies in a jar
> PICAPTURE HD 76
raspberrypi.org/magpi April 2017 5
News FEATURE
FIFTH
BIRTHDAY
PARTY
Raspberry Pi celebrates its first five years Philip Colligan welcoming people to
the Big Birthday Party 2017
early 1,500 members of the Foundation, Code Club, and active world, said Philip Colligan, CEO
N Raspberry Pi community
attended the Fifth Birthday
members of the community.
The MagPi team had a stand at
of Raspberry Pi Foundation.
In the main hall, dozens of
Party for the organisation. the party. We showed off recent digital makers showed off their
Held at Cambridge Junction projects including the PiGRRL2 latest builds. Party-goers played
arts centre on 4/5 March, the from the cover of issue 55. Spanner Spencers four-player
Big Birthday Weekend 2017 Sam Aaron and Ben Smiths Gauntlet, Steve Uptons Pi
saw hundreds of Raspberry Pi Sonic Pi workshop was especially Bash, and NuStems Technology
community members gather impressive. They demonstrated Wishing Well.
together to share projects and cake. live coding with a mind-blowing
The Twitter hashtag #piparty live performance (watch online: A special year
even became a Twitter Moment, magpi.cc/2m6mlQm). Its been another interesting,
Below Digital
makers shared gaining global coverage. We describe our mission as weird, and surprising year for
inspiring projects
The party featured workshops putting the power of digital making us at Raspberry Pi, said Eben
with the Raspberry
Pi community and talks from the Raspberry Pi in the hands of people all over the Upton, founder and CEO of
Raspberry Pi Trading.
The Raspberry Pi is an incredibly
important computer because it
exists in a world of computers
that are expensive or inaccessible.
You cant let your child play with
the family computer any more
than you let your child take the
family car apart, explained Eben.
The Raspberry Pi is a fantastic
platform for digital making and
experimentation. Its fun and
low cost.
One interesting development is
that Raspberry Pi has become an
advocate for British manufacturing.
I didnt think that is what wed be
when we built our first units five
years ago, said Eben
We are not building units in
the UK because we are patriotic,
he explained. We are building
PI PARTY
IN NUMBERS
them in the UK because we are make, using the resources, and the
cheapskates who want to build infrastructure we create, to make
cheap but high-quality products. the difference.
It turns out that the cheapest place Fran Scott ended the party
to build products is here in the with a Live Coding Explosions
United Kingdom. show, using a Raspberry Pi to
Eben also revealed that the Pi Zero W Raspberry Pi 3 has accounted for
almost a third of all Raspberry Pi
NEW
The Pirate Radio Kit enables you to build your own internet radio
PIMORONI
KITS
Four new projects for Pi Zero W
imoroni has released four new project kits to
P sit alongside the new Pi Zero W board. Each
kit contains a Pi ZeroW board and GPIO pin
header, requiring some basic soldering. Light up your room by programming the multicoloured LEDs
As soon as we heard about the Pi Zero W, we knew
that its features would make IoT projects much more
approachable, says Paul Beech, Pimoroni
co-founder. These kits are made to appeal to
everyone, to inspire people to try IoT and crafting.
The Starter Kit (32) contains a Raspberry Pi,
microSD card, Pibow case, and Blinkt! LED strip.
10 April 2017
xxxx 2016 raspberrypi.org/magpi
RX300 THIN CLIENT News
RX300
THIN CLIENT
NOW TRENDING
The stories we shared that
flew around the world
PIPARTY
magpi.cc/2mmx8mn
raspberrypi.org/magpi February
xxxxx
April 2016
2017 11
News BLOG IN A BOX
CAMBRIDGE
THEME FOR PIXEL
New desktop images for Raspberry Pi Left The Senate
House of the
produced to honour Cambridge roots University of
Cambridge, lit up
at the e-Luminate
Festival 2017
he Raspberry Pi Foundation has released a
T selection of new wallpapers and a screensaver
for the Raspbian with PIXEL operating system.
The optional new look for Raspbian is based on the
city of Cambridge, UK.
The connection between Raspberry Pi and
Cambridge runs a lot deeper than mere geography,
says Simon Long, UX engineer.
He explains, Raspberry Pi was founded with the
aim of increasing the number of applicants to study
computer science at the University of Cambridge. The
processor core which powers the Raspberry Pi was
developed in the city by ARM, the hugely successful
microprocessor company which itself grew out of
Acorn, one of the original pioneers of the 1980s
home computer revolution, and another Cambridge
success story.
A few months ago, Eben Upton and Simon were
looking at the beautiful city flyover videos that Apple
offers as screensavers on the Apple TV. We thought
that it would be great if we could do something
similar for Raspbian, with Cambridge as the subject,
recalls Simon. So we enlisted the help of Cambridge
Filmworks (magpi.cc/2mHzz1D).
Cambridge Filmworks specialises in filming with
drones, and they put together a video showing
the best of Cambridges architecture, recorded
from the air.
The new screensaver is gorgeous. Once installed,
you access it via Menu > Preferences > Screensaver.
To install both:
sudo apt-get install cantab-theme
BUILD AN
Michael Horne and Tim
Richardson run the Cambridge
Raspberry Jam and are active
members of the Raspberry
Picommunity.
camjam.me
EASY ROBOT
Get a CamJam robotics kit and make a wheeled rover in an afternoon
uilding a robot is a dream Tim Richardson, the guys who run batteries, as cheap ones often
B for many new Raspberry
Pi owners, and its
CamJam and Pi Wars.
Inside the box, you get a
dont have enough juice to move
the wheels.
way easier to get started than custom motor controller made The kit comes with two sensors:
you think. by 4Tronix (4tronix.co.uk). This an SR-04 distance sensor and a
One of our favourites is the sits between the two DC motors line-following sensor. The only
EduKit 3 Robotics by Cambridge and a battery compartment, thing you dont get is a chassis.
Raspberry Jam. The kit is which takes four AA batteries This is part of its charm, though,
designed by Michael Horne and make sure you buy high-quality as you can build a robot out of
any box capable of containing the
Raspberry Pi. Its even possible
to use the box that all the
components come in.
What makes the CamJam
EduKit3 better than other
robotics projects is the quality of
the instructional material. There
are ten different worksheets,
covering everything from building
the robot to driving the motors
and setting up the sensors.
BUILD A NES
FROM LEGO
Make a retro gaming console from toy bricks
Intermediate
DAN KING
Dan is a software
developer and
digital designer from
Syracuse, New York.
CREATE
magpi.cc/2mJz9e4
A WALL
DISPLAY
Turn an old monitor or picture
frame into a connected wall
display with DAKboard
ooking up a Raspberry
YOULL H Pi to a monitor is one of
NEED the easiest things to do.
In fact, thats pretty much what
>R
aspberry Pi you do when you first set up a
computer (plus Raspberry Pi.
WiFi dongle,
Thats one of the things that
if using the Pi
version 1 or 2) makes DAKboard such an enticing
project. DAKboard is a gorgeous
GB+ SD/micro
>8
SD card web interface that displays
icro USB
>M
photographs, weather and other
charger (for information (such as events
Raspberry Pi) from your calendar or Wunderlist
ower
>P todo list).
extension cord Start with a fresh installation
hoto frame
>P of the Raspbian OS on your
wire Raspberry Pi.
Begin by connecting to a wireless
network. Click on the networking
Challenging
An AdaFruit touchscreen is held
firmly in place with two rubber bands
(red and blue). This enables you to
control the device out in the field
MAKE
PINOCULARS
The PiNoculars project is an excellent way to recycle an old pair
of binoculars into a high-tech zoom recording device
he Raspberry Pi Camera Created by digital maker Josh
YOULL T Module is a great tool for Williams, PiNoculars are a regular
>STEP-01
Set up the camera and touchscreen
First, attach a Camera Module to your Raspberry
Pi board and set up a capacitive touchscreen
detailed instructions for two different doesnt have to be perfect, but try to display. This will enable you to control the project
types of PiNoculars. One follows the position the camera mount as close to on the move.
duct tape and foam route, while the the centre of the eyepiece as possible.
second is a more complex build using Josh then uses rubber bands >STEP-02
laser cutting to create a mount for the to hold the Raspberry Pi and Attach the camera
Raspberry Pi and touchscreen. screen unit in place on top of the Cut out a foam circle the
I used Adafruits [PiTFT] binoculars, and duct tape to fix same size as the eyepiece
capacitive touchscreen, says the binoculars and Raspberry Pi on your binoculars (it needs
Josh. Their tutorials made it together. Be careful not to crush to cover the eyepiece
incredibly easy to attach to the Pi your LCD, he says. More duct tape completely). Mark an X in
(magpi.cc/2mCpVy3). Josh suggests is used to attach the foam mount the centre and draw an 88mm
square in the centre of the circle. Push the
that makers read Adafruits DIY WiFi over the PiNoculars eyepiece.
Camera Module into the foam and position
it in front of the eyepiece.
There are a number of people
whove combined the Raspberry Pi >STEP-03
Fit it together
with microscopes and telescopes Use rubber bands to hold the Raspberry Pi and
touchscreen display vertically on top of the
Raspberry Pi touchscreen camera Then its just a case of moving binoculars, with the screen facing towards the
tutorial by Phillip Burgess and the everything around until it is firmly eyepieces. Now use duct tape to secure the
Ruiz Brothers (magpi.cc/2m9Bxfv). fixed, and the camera can record a Raspberry Pi firmly, and a smaller piece to secure
The most time-consuming part well-defined circle. the foam-encased Camera Module. A portable
of the build is creating a mount that If youre a perfectionist, theres power back enables you to take the PiNoculars
wraps around the pair of binoculars, a much more detailed method, out in the field for long-range video recording.
but you can skip all this by using involving precision design with
foam and duct tape. Inkscape (inkscape.org) and a laser
After setting up the Raspberry cutter. But we like a quick hack, and
Pi with the Camera Module and this is a great project for making
Adafruit touchscreen, the whole kit something quick and impressive.
is mounted on top of the binoculars. There are a number of people
The first step is to mark up and whove combined the Raspberry Pi
cut out a circle of foam. This serves with microscopes and telescopes,
as a mount for the Pi camera, to hold says Josh, whos fascinated by them.
it in front of the eyepiece. Remember to measure twice,
The camera mount should barely he warns us, and callipers are
cover the eyepiece, says Josh. It beautiful tools.
Challenging
MAHMUT
Mahmut is a computer
engineer and maker.
He is working with
his friend, Metin, on
Sixfab Raspberry Pi
BUILD A
4G/LTE projects.
magpi.cc/2nSlpvp
YOUTUBE DRONE
Add a Camera Module to a drone to broadcast footage straight to YouTube
his smart drone broadcasts Pi with network coverage lets you Set Make Yourself Drone Kit
UK DRONE LAW
The UK Civil Aviation Authoritys The
Drone Code is a guide to flying drones
for fun (magpi.cc/2nRZAw2).
STREAMING
LIVE VIDEO
>STEP-01
Set up the shield
A Sixfab 4G/LTE shield is connected to the
Raspberry Pi. This provides a persistent data
connection, enabling the Raspberry Pi to stream
data to YouTube and other websites.
PICADE
magpi.cc/2nSOfvv
180
$239 PIRATE RADIO
magpi.cc/2nSEOfE
40
$49
Creating a retro arcade system is a dream for many This kit has everything you need to create a
makers. Building a cabinet from scratch can be a radio with your Raspberry Pi. It contains the
costly and difficult enterprise. Picade makes it all new Pi Zero W and a pHAT BEAT (DAC and
a lot easier, though. Its powder-coated cabinet stereo amplifier). You also get a 5W speaker.
feels like a real arcade cabinet. It comes with a PCB, The plastic case has a VU meter so you can
joysticks, and 12 arcade buttons. view the sound levels. You will need to solder
the GPIO header on to the Pi Zero W, and a
female header to the pHAT BEAT.
PI-TOP
pi-top: 229.19 / $264.99
pi-topCEED: 109.99 / $164.99
pi-top.com
The pi-top and pi-topCEED are
projects to turn your Raspberry Pi into
a laptop or desktop computer. Unlike
a regular laptop or desktop, these are
module DIY computers that are ideal
for mobile making. You can 3D-print
the case and buy the components,
magpi.cc/2nSXHPs
If youre looking for a retro PI ZERO CCTV KIT (LITTLE BRO) 24
gaming console, then look at this
magpi.cc/2nSMYVz $29
Retro Gaming Bundle from The
Pi Hut. It contains a Raspberry Start your mini surveillance state with this
Pi 3 and two SNES-style USB sign that houses a Pi Zero and a Camera
gamepads. You also get a long Module. The camera logo on the sign has a
HDMI cable, an official Raspberry hole for the Camera Module. You need to
Pi power supply, and a 16GB SD buy the latter separately, but can combine
card. All you need to do is install it withOpenCV computer vision to create a
RetroPie (retropie.org.uk). smart CCTV Camera that recognises people.
DIDDYBORG
like your average turtle
robot. It can raise or lower
the pen to draw shapes
on paper. Turtle robots magpi.cc/2mHbmbp
have a long history There are many robotics kits for the Raspberry
in computing and maker Pi, but PiBorgs DiddyBorg is perhaps the most
culture, and theyre a great project for comprehensive. It has a robust laser-cut chassis
learning logic (and to see code in action). with six 60rpm motors. The DiddyBorg comes with
a PicoBorg Reverse motor controller and a BattBorg
naturebytes.org 32.99
If youve ever wanted to record the
critters in your garden, then the
Wildlife Cam Kit is the way to go.
MEARM $41.21
Its PIR sensor detects movement
magpi.cc/2nSOlDo
and triggers the Pi Camera Module Not all robots have wheels. The MeArm is a flat-pack
to take a stealthy snap. Its ideal for robot arm kit that you build. It can then be controlled
educational use. The Cam Kit is also via Python or directly with a joystick. Its very easy to
very versatile and can be used for assemble, using just a screwdriver, and we think this
time-lapse photography, night-time is a great kit for anyone wanting to step into the world
shots (with a Pi NoIR camera and IR of digital making.
LED lighting), or even a live video feed.
LIV PI
livpi.com
240
$250
LiV Pi comes from Hong Kong, where pollution has been a problem
for many years. With air quality increasingly a concern in cities across
the world, its a great way to learn more about pollution (and keep an
eye on levels in your area). Inside the kit are three sensors: carbon
dioxide, temperature/humidity, and air pressure. Its not a cheap
project, but it is a professional air-monitoring system.
FREE
PI ZERO W
Subscribe in print for 12
months today and receive:
A free Pi Zero W (the latest model)
Free Pi Zero W case with 3 covers
Free Camera Module connector
Free USB and HDMI converter cables
....................................................................................................................................
$69 (USA) *If giving The MagPi as a gift, please complete both your own details (above) and the recipients (below).
Address ........................................................................................................................
80 (EU) Name and full postal address of your bank or building society:
$129 (USA)
Address ...........................................................................................................................
........................................................................................................................................
n n n n n n Account number n n n n n n n n
Branch sort code
Get three issues: Please pay Select Publisher Services Ltd Direct Debits from the account detailed in this instruction
subject to the safeguards assured by the Direct Debit Guarantee. I understand that this instruction
may remain with Select Publisher Services Ltd and, if so, details will be passed electronically to my
bank/building society.
$37.50 (US) (quarterly) SUBSCRIPTION PRICING WHEN PAYING BY CHEQUE OR CREDIT/DEBIT CARD
Quick
Facts
> The original
version
featured a Pi
NoIR camera
PIMINIMINT
A fully functioning computer and display crammed into a mints tin
att Wagner first thought and the low availability of Zeros to a 2-inch LCD display and
M
> Sugru stops the
charger port about fitting a computer made it challenging to find and thanks to a RedBear IoT pHAT
moving around
into an Altoids tin in use for anything at the time, he equipped with WiFi and Bluetooth.
> Hot glue is 2012, shortly after the launch of recalls. However, I now work in an The original design took a few
added to
the original Raspberry Pi. While it environment [Micro Center store] weeks, between prototyping
secure solder
points wasnt quite possible back then, surrounded with DIY materials, and sourcing parts, Matt tells
the release of the considerably so the idea just came back to me us. The concept of it is simple:
> Matts new
model will smaller Pi Zero changed everything, one day. strap together already available
feature a although not immediately for Matt. The result is the PiMiniMint, components. In actuality, though,
phone SIM
I was deep into another project, containing a Pi Zero connected sourcing parts was a bit of an issue
> Planned
Pi projects
include smart
luggage The 2-inch screen and
tracking its board are taped to
to the lid of the tin
HOW TO TIN A PI
Rear solder pads on the Pi Zero are
used to connect the charger and
switch, and power wires for the screen
(shipping costs, and buying pre- Changing to a better switch did >STEP-01
made parts gets very expensive), the trick. Matts 2500mAh LiPo Mount the screen
so I had to find creative ways to provides impressive battery life: The 2-inch screen is attached to the lid of the Altoids
solve problems. I havent done a full 100%-0% tin using double-sided tape. The display boards
This included a solution for test and timed it, but I have had it white charge port needs to be near the hinge to avoid
rechargeable battery power. In on for six-plus hours at a time. stretching the wires.
my first iteration, I had no way One drawback of using a built-in
to charge the battery, explains battery was that there was no longer
Matt. An Adafruit PowerBoost room in the tin for the infrared
would have been ideal, as it puts camera and full-size exterior USB
out enough amperage, but the cost port featured in the original design.
would have been tight for me. The However, I do still have an interior
[Pimoroni] Zero LiPo is amazing, full-size USB [via an adapter] that is
and I am currently using it in an available when opened.
ongoing project of mine; however, Matt is currently making a
it sits too high on the GPIO and second PiMiniMint for a friend,
wouldnt allow for the lid to close featuring a few modifications: His
with the screen inside. is going to have two on-board WiFi
In the end, at the suggestion of antennas and a dedicated SIM for
a co-worker, Matt opted to modify transmitting data over 3G/4G. >STEP-02
a standard USB phone charger, As well as it being a cool pocket Make a charger
extracting its charging circuitry to PC, Matt thinks the PiMiniMint is Matt stripped the mini circuit board from a standard
use with a slimline LiPo battery. ideal for portable retro gaming. phone charger and removed its USB port. This board
He also added an on/off switch. I Additionally, I have used it as a is then soldered to a slimline LiPo battery, and
had some issues regarding wiring WiFi access point for saving files connected via a switch to the Pi Zero.
and power needs, but those were to, a WiFi repeater by plugging a
related to where in the circuitry second WiFi antenna into the USB
I put my switch, and the kind port, and Im sure there are more
of switch I used, he reveals. ideas out there!
Amazingly,
everything
fits into the
6095mm
Altoids tin;
theres even
room for a
USB adapter
>STEP-03
Add connectivity
A headerless RedBear IoT pHAT is soldered
directly via a male 40-pin header to the Pi Zero to
provide WiFi and Bluetooth connectivity. If using
the new Pi Zero W, this could be omitted.
PI FILM
CAPTURE
Expertly converting old film reels to digital video one frame at a time
Quick
Facts R
estoring home movies
captured on film can be
run the movie and record it using
a camcorder. The results from that
repeats the process until the
entire reel is captured. Most old
a real challenge. Film approach are very poor, though. projectors would work, reckons
> A five-minute
conversion is a time-consuming Professionals photograph one Joe. They were built to last.
film reel can
produce 4,000 and often expensive task. still image at a time and then stitch Once the process is completed,
still images One maker, Joe Herman, took it all together, which is why the the result is a folder of images.
> 8mm captures matters into his own hands by process is so expensive. I can combine these quickly into
need a 25mm hooking up a Raspberry Pi Camera Pi Film Capture is a smart a viewable movie using FFmpeg
focal length
magnifying lens
Module to an old projector. film transfer system that uses a (ffmpeg.org), says Joe. If a
Joes cousin and uncle uncovered Raspberry Pi and Pi Camera Module more sophisticated clean-up is
> The projector
uses a NEMA
a box of 130 reels recorded by his with Bell & Howell 8mm and required,he uses a program called
17 motor and a grandfather. Leos moves dated Super 8 projectors, or an Ampro AviSynth (avisynth.nl).
DRV8825 chip back to 1938, says Joe. Imperial 16mm. A key design goal for me was
> Joe 3D-printed The preservation of these The setup employs a frame-by- to use easily obtainable parts,
mounts for the memories was important for Joes frame approach. The Raspberry Pi revealsJoe. Mostly because when
lamp and motor
large extended family. But to have takes a still photo of a film frame I began the project, I was unsure
> It uses the them professionally restored and sends it to a remote client whether it would go anywhere and
original 5MP
Camera wouldhave cost many thousands computer for processing. didnt want to invest too much in
Module of dollars. The Raspberry Pi is connected expensive equipment.
The obvious approach with to a stepper motor that moves Joe solved endless challenges
a project like this would be to the frame to the next cell. It then while designing Pi Film Capture.
BUILDING A CINE-CONVERTER
FLYAI
is pumped into the chamber
Facts
spied on by a camera, as a Theyre often a stand-in for
disembodied voice reads out image the absurd or, thinking about
recognition data that determines collective behaviour, the will of the
> The flies can whether or not they will be fed. collective, although their actions
live for 30-40
days This is the unsettling theme of flyAI arent quite as random as you
(magpi.cc/2n7pijV), a Pi-powered might expect: They do like to work
> David says
hed intervene art installation by David Bowen, their way to the tops of containers;
if needed who was inspired to create it after theyre attracted to light.
> The work isnt reading philosopher Nick Bostroms Also, they dont elicit as much
anti-AI, just a Superintelligence: Paths, Dangers, empathy from viewers as another
commentary
Strategies. The book explores the living creature, adds David. Thats
> Previous prospective effects of future super- probably just as well given the
projects include
intelligent AI on the human race nature of flyAI, in which the flies
tweeting flies
and while there are some utopian survival depends on the accuracy
The capture is analysed and > Hes hoping to
possibilities, David says there are of image recognition. A regular
classified by Google TensorFlow, exhibit flyAI in
which lists the top five possibilities the autumn also dangers: The AI could end up USB webcam positioned at the top
repurposing our atoms for food! of the custom-built fly chamber is
n our beginners guide to the command across, youll be able to find out more information on
I line (The MagPi #54), we looked briefly at
man, the manual you can access from the
how to use it.
The synopsis gives a brief outline The description gives a detailed Many commands have options,
of how to use the command. In this case, outline of the tool. It also offers typically a hyphen followed by a letter
you need to enter the command, an information on how it works (or double-hyphen followed by a word).
option, and an account name. The parts Youll find each option outlined in detail
in brackets are optional in the man page
34 April 2016
xxxx 2017 raspberrypi.org/magpi
COMMAND LINE Tutorial
move to the next page, and press Q to exit the page man bash
and return to the command prompt. info bash
Man pages can be a bit tricky to read at first, but
youll soon get the hang of it. While man bash gives you a brief description of the
At the top are the Name, Synopsis, and GNU Bourne-Again Shell and the options used with the
Description sections. Read these to get an overview bash command; info bash gives the whole history
of the command. Below them youll find options and hundreds of pages of detailed information.
and parameters; read these carefully to discover Press H on an info screen to view the controls for
ways to expand your usage of each command. Its a navigating such long documents. As well as SPACE to
good idea to use man on any commands you know, move down, you use DELETE to go back a screen, TAB
and read the manual for any new Linux commands to highlight links, and RETURN to use them. Press Q
you come across. to exit the help screen.
You can even read a man page for man:
Many commands
feature a built-
in help option,
man man accessed with -h
or --help. Using it
offers a brief outline
Press H in the man screen to view a summary of
navigational key presses. These are worth learning
so you can do more than press space to move to the
next page.
Mans lesser-known partner is info, which is
used to display information pages associated with
commands. Sometimes these are the same as the
man pages. In other cases they provide a different
description. Try these:
raspberrypi.org/magpi xxxxx
April 2016
2017 35
Tutorial RASPBERRY PI 101: GET HELP FROM THE COMMAND LINE
TAB AUTOCOMPLETE
Another way to find files is to use tab autocomplete.
By pressing the TAB key, you can automatically
complete commands, files, and directories on the
command line. If youre not doing so already, learn to
press TAB a lot on the command line: its a good way
to discover new commands.
Take the apt tool, for example. There are apt-get
and apt-cache, but did you know about apt-config
and apt-key?
Enter:
apt
And press the TAB key twice. It will display all the
different types of apt available.
FINDING COMMANDS Apropos is used to
search the manual You can even run through the letters of the alphabet.
for matching words.
As you become more familiar with man and info, With it, you can find Enter the letter a:
youll start searching for commands to look up. Here, commands based
on subjects, such as
the man -k command comes in useful. In particular, directory, password, a
or links
try this:
And press TAB twice to view all the commands
man -k directory | more beginning with a. You can then use man to look
up commands. Its a great way to broaden your
This command lists all available man entries. knowledge of the command line.
Press SPACE to run through them one at a time.
The man -k option is worth remembering. If you use EXPRESS HELP
manman, it tells you the -k option is equivalent to Many commands also offer a help feature as an
apropos. Apropos is used to search manual page option. Help is typically accessed using -h or --help:
names and descriptions. Its a handy way to find
commands when you dont know their names. Enter a single
letter and press
mktemp --help
For instance, enter: TAB twice to view
all the commands
available in that This command displays the options offered by the
letter. Then use
apropos directory whatis to get a
mktemp command. Its the same as the first page of
short one-line mktemps man file, but saves you digging in and out
description of
and youll get a list of all the commands that have each command of the full document.
the word directory in their description or page
name. Here youll find common commands such
as ls, cd, and pwd, but youll also find less obvious
commands, such as mktemp.
Next to each command is a number, like (1) or
(2). These correspond to the section numbers of the
manual (view using man man).
The section numbers are useful for guiding you
to the commands that can be used on the command
line. As a general rule, 1: Executable programs or
shell commands, and 2: System calls, both tend
to be worth investigating. Higher numbers are for
library calls, special files, and kernel routines for
advanced users.
You can find out more information about any
command using man:
man mktemp
36 April 2016
xxxx 2017 raspberrypi.org/magpi
COMMAND LINE Tutorial
Not all commands make use of --help. Some, like One final command worth using when searching
ls--help, display the full man document (you can for commands is whatis:
pipe this through less:
whatis pwd
ls --help | less
This example returns print name of current/working
but its typically easier to use man ls. Some directory. Often, this brief description is enough to let
commands dont implement the help option at all. you know what it does, or at least tell you if its something
youd like to investigate further with man or info.
pwd --help These are just some of the tools you can use to
get help at the command line in Linux. While the
returns invalid option. But its worth trying when command line may seem intimidating at first, youre
you are experimenting with new commands. far from alone in this text-only environment.
WEB
SEARCH
One of the advantages when using a desktop
interface, like Raspbian, is that a web browser
and a search engine is just a click away.
Getting online from the command line is a
lot easier than youd imagine. There are many
different text-based web browsers that enable you
to access Google, Bing, DuckDuckGo, and other Other keyboard shortcuts can be used to navigate
websites without having to boot into the PIXEL the program:
desktop interface.
Were going to use: g - Goto URL
sudo apt-get update && sudo apt-get upgrade Down Arrow - Next link
sudo apt-get install elinks
Up Arrow - Previous link
Now you can open the web browser from the
command line using: Return - Select link
You can also enter Google search terms in the URL < - Previous tab
field. Press g, then enter g the magpi to search for
our website in Google. c - Close tab
raspberrypi.org/magpi xxxxx
April 2016
2017 37
Tutorial RASPBERRY PI 101: POWER YOUR RASPBERRY PI
POWER YOUR
RASPBERRY PI
Dont let your Raspberry Pi suffer from a shortage of volts
owering your Raspberry Pi is, on the surface, The Raspberry Pi boards typically draw much lower
Youll P a remarkably simple affair. All Raspberry Pi amounts, between 200 and 500mA.
Need
boards are designed to use the same micro Usage depends on what youre doing with the Pi.
USB power socket as many smartphones. All you need Playing video and browsing the web draws more power
is a spare USB adapter, and it will provide power to than idling and booting. It also depends on what
> Raspberry Pi your Raspberry Pi. devices you have connected; some keyboards and mice
> Raspbian OS Thats the basic requirement. Of course, this being draw more power than others.
a board for makers and hackers, theres far more to
> Power supply
it than that. Learning how to properly supply the Low power warning
right amount of power to your Raspberry Pi board is So, the Raspberry Pi can function on lower power
important as you start to create complex projects. supplies, but it may have problems when you start to
A 5V micro USB typically powers the Raspberry Pi. do demanding tasks or add peripherals.
But how much current (in milliamps or amps) the Pi The Raspbian operating system comes with a low
requires to function depends on your usage. voltage indicator icon. This yellow lightning bolt
The recommended amount is between 700mA for a appears in the top-right of the screen. It is used to
Raspberry Pi Model A, and up to 2.5A for a Raspberry indicate an under-voltage warning.
Pi 3 Model B (see Power Supply Requirements box).
38 April 2016
xxxx 2017 raspberrypi.org/magpi
POWER YOUR RASPBERRY PI Tutorial
The Raspberry Pi
Universal Power Supply
Power Usage
is a reliable source of
power for your board Pi 1 (B+) Pi 2 B Pi 3 B Zero
Boot Max 0.26A 0.40A 0.75A 0.20A
Avg 0.22A 0.22A 0.35A 0.15A
Idle Avg 0.20A 0.22A 0.3a0A 0.10A
Video playback (H.264) Max 0.30A 0.36A 0.55A 0.23A
Avg 0.22A 0.28A 0.33A 0.16A
Stress Max 0.35A 0.82A 1.34A 0.35A
Drawing too much power from the Raspberry Avg 0.32A 0.75A 0.85A 0.23A
Pi board isnt dangerous, but it can cause erratic
behaviour. If you want to attach several performance- Test conditions used a standard Raspbian image (26 Feb 2016), at room
heavy peripherals to your Raspberry Pi, its best to use temperature, connected to an HDMI monitor, USB keyboard, and mouse.
a powered USB hub. For the Model 3B it was connected to a WiFi access point. All these power
measurements do not take into account power consumption from additional
Official supply USB devices; these measurements can easily be exceeded with multiple
The Raspberry Pi Universal Power Supply additional USB devices connected or when using a HAT.
(magpi.cc/2a14pye) is a dependable power source.
Itll keep feeding your Pi the steady 2A it needs for Power via HAT
proper performance. If youre worried about getting If youre looking to power the Raspberry Pi via the
stable power, then its a good idea to invest in a GPIO pins, then its best to go via a HAT. The hardware
suitable adapter. sits on top of the GPIO pins and adds the safety
features you need.
Power via GPIO
A more technical (and dangerous) way to power the Power over Ethernet
Raspberry Pi is via the GPIO pins. Supplying power to your Raspberry Pi via the Ethernet
The 5V GPIO pins on a Raspberry Pi are connected cable is an attractive proposition, but its not provided
to the 5V rail. Typically they provide the remaining as standard. If youre interested in providing power to
power from the Raspberry Pi (that isnt being used your Raspberry Pi via a network cable, then take a look
topower the board itself). So you can hook up the at the Pi PoE Switch HAT (magpi.cc/2lhnDDT).
GPIO 5V pins to a 5V power source and feed power
directly to the board. Mobile power
It is possible to provide power to the device from a
Connect a 5V source to Pin #2 (5V). battery pack designed for mobile phone charging.
Connect the ground of that source to Pin #6 (GND). Companies such as Anker (anker.com) and
Poweradd(ipoweradd.com) are known for their
Please be aware that there is no regulation or fuse mobile charging solutions.
protection on the GPIO to protect from over-voltage But if you want something a little more serious,
or current spikes. we reviewed the Zero LiPo in issue 51 and found it a
If an incorrect voltage is applied, or a current spike smart solution to portable power. It supplies power
occurs on the line, you can permanently damage your from lithium batteries via the GPIO pins with safety
Raspberry Pi. management features (magpi.cc/2coJyZ2).
raspberrypi.org/magpi xxxxx
April 2016
2017 39
Tutorial STEP BY STEP
PHIL KING
When not sub-editing The MagPi
and writing articles, Phil loves
to work on Pi projects, including
wheeled robots.
@philking68
CREATE AN LED
THERMOMETER Read a temperature sensor and display its value as a bar graph
Youll >STEP-02
Need A
nalogue readings on the Pi require an
analogue-to-digital converter (ADC) chip such Connect the ADC
as the MCP3008. Its a pretty popular ADC, so Its best practice to turn off the Pi while creating
> GPIO Zero
Pythonlibrary
like many other things youll find it in the GPIO Zero our circuit. As you can see from the diagram below,
Python library. Well use one to display the current theres quite a lot of wiring required to connect the
> 1 solderless
breadboard temperature on the screen, then add some LEDs and MCP3008 ADC to the Pis GPIO pins.
use GPIO Zeros handy LEDBarGraph class to get them First, place the MCP3008 in the middle of the
> 1 MCP3008
ADC chip to light up according to the temperature. breadboard, straddling its central groove. Now
connect the jumper wires as in the diagram. Two go to
> 1 TMP36
temperature >STEP-01 the + power rail, connected to a 3V3 pin; two others
sensor Enable SPI are connected to a GND pin via the rail. The four
> 5 LEDs (red, The analogue values from the ADC chip will be middle legs of the ADC are connected to GPIO pins 8
yellow, green) communicated to the Pi using the SPI protocol. While (CE0), 10 (MOSI), 9 (MISO), and 11 (SCLK).
> 5 330 resistors this will work in GPIO Zero out of the box, you may get
> 8 male-to-male
python-spidev 7. Here, well connect a TMP36 analogue temperature
jumper wires sensor. Its vital that this is wired up correctly,
Click OK and reboot the Pi. otherwise itll overheat. With its flat face towards
ch10listing2.py
function from the time library. Next, we define a
function that converts the sensor reading into degrees
Celsius. We then assign the adc variable to channel 7 of
the MCP3008. Finally, we use a for loop to display the from gpiozero import LEDBarGraph
converted temperature on the screen, updating it every from time import sleep
second. Note: if youve just been handling the sensor,
it might take a little while to settle down. graph = LEDBarGraph (26, 19, 13, 6, 5, pwm=True)
ch10listing3.py
a more accurate display. We then set graph.value to
various fractions between 0 and 1 to light the relevant
number of LEDs from green to red, including partially
lit ones for precision. Note that if the value is negative, from gpiozero import MCP3008, LEDBarGraph
it will light the LEDs from the other end, red ones first. from time import sleep
AN INTRODUCTION TO C PART 10
#include <stdio.h>
CHECK THE
LIBRARY /home/pi/input.txt, with the mode rb, for read
void main (void) binary. This creates the file pointer and initialises it
The C library
offers a wide
{ to the beginning of the file.
range of FILE *fp; We then check to see if the file pointer is non-zero
functions for int value; if the pointer is returned as zero, the file wasnt
reading and
successfully opened. (For a read, this usually indicates
writing data
from and to fp = fopen ("/home/pi/input.txt", "rb"); that the file doesnt exist.)
files; we've just if (fp) We then repeatedly call the function fgetc (for file
looked at some
of them. If you
{ get character) each time this function is called, it
need to access while (1) reads a single byte from the file, and then advances
a file, have a { the file pointer to the next byte. When the file pointer
look at some of
the other library
value = fgetc (fp); reaches the end of the file, it returns the special value
functions like if (value == EOF) break; EOF (end of file). So we print the value returned by
fread, fwrite, else printf ("%c", value); fgetc each time until it returns EOF.
fscanf, fputs,
and fgets
} Once we have finished reading the file, we stop
to see if they fclose (fp); access to it by calling fclose (for file close).
are more } Note that while fgetc reads characters, it returns
appropriate
than the basic
} an integer this is because the code for EOF falls
fputc and outside the valid range of a char variable (0-255).
fgetc we've We create a file pointer using the command Unless at end of file, fgetc returns an integer value
used here.
fopen(short for file open) we open the file at which can be treated as a char.
25 25
30 30
A B C D E F G H I J
Youll BUILD A
REACTION GAME
Need
> 2 red LEDs
> 2 Tactile
push buttons
Make a fast-paced reaction game and challenge your friends to find out
> 5 470 resistors who has the best ninja reflexes!
> 8 Male-to-
sing a breadboard and some simple >STEP-01
U
female jumper
wires components, make a super-fun reaction game Connect the LEDs
> 4 Male-to-male while learning how to use a breadboard to Gather the components as listed on the left. Following
jumper wires make an electronic circuit, as well as programming the breadboard diagram, attach the two red LEDs to
> Alternatively, in Python to make your game even better! The game the breadboard, at either end. You must ensure that
Monk Makes involves a race against an opponent, but there are a the long leg of the LED is facing down, on both LEDs.
Raspberry Pi
Electronics
handful of trick signals thrown in for good measure, This is the positive leg, which will be connected to a
Starter Kit so dont get too complacent. The project is designed as positive output on the Raspberry Pi. The big RGB LED
magpi.cc/ an extension to the projects found in the Monk Makes can be connected in the middle of the breadboard,
2lWlZHp
Raspberry Pi Electronics Starter Kit. on the right-hand side, as shown. There is one leg
longer than the rest, which will be connected to the
second hole from the top (shown by a red circle on
the diagram). This is the negative leg.
>STEP-02
Add the resistors
In order for the LEDs to work correctly, a resistor
needs to be added in series to each one, limiting the
flow of current so they dont melt! You will need five
resistors, as the RGB LED counts as three separate
LEDs that share the same cathode (negative leg).
Connect three resistors to the LEDs positive legs,
bridging the gap across the centre of the breadboard,
as shown in the diagram. All of the pins in each row
are connected to each other inside the breadboard,
Above It's a simple circuit, but you could easily turn it into
a physical game with some 3D-printed parts with a gap in the centre.
CODE NAME:
02_reaction_game.py
DOWNLOAD:
magpi.cc/2nIWsTe
>STEP-03
Add the buttons
This project needs two buttons: one for each player.
Some small buttons have four legs, as shown in the
diagram, and a connection is made between the
diagonal pins when it is pressed. If you have a button
with two legs, simply connect it to the breadboard
with one leg on either side of the central gap, ensuring
that the jumper wires are connected to the same row
as the button. As you can see from the diagram, the
button will be connecting a Raspberry Pi input pin to
ground when pressed.
>STEP-04
Finish up
Using the five male-to-male jumper leads, follow
the diagram to connect all the negative legs on the
LEDs and the buttons together, which can then be
connected to a ground pin on the Raspberry Pi. The
eight male-to-female jumper leads can then be used
to connect the positive sides of the LEDs to the Pis
output pins, as well as connecting the two buttons
Above For a tidy breadboard, trim the legs of the components
and the common ground connection. Ensure that and jumper wires so that they sit neatly on the surface
each jumper lead is connected to the correct pin on
the Raspberry Pi, as this is crucial for the code to run >STEP-06
correctly with the hardware. How to play
When you run the program, you will first need to
>STEP-05 type the names of the two players. Player ones
Install the code button is located at the bottom of the breadboard
Using the latest version of Raspbian (PIXEL) on and player twos at the top (as shown on the
your Raspberry Pi, you can now boot up. If you diagram). Whenever the RGB LED in the centre of
are not using this version of Raspbian, you will the breadboard lights up in any colour other than
need to install the GPIO Zero library if you havent red, press your button as fast as you can. The first
already. Youll need to make sure that your Pi is player to hit their button will gain a point. However,
connected to the internet, via WiFi or Ethernet. beware! If the RGB LED lights up in red, do not press
When booted, open the terminal window and type: your button. If you do, one point will be deducted
git clone https://github.com/henrybudden/ from your score! After each round, the score for each
rpesk-advanced/. This will download the Python player is displayed on the screen, and one of the
files from GitHub, onto your Raspberry Pi. Once this small red LEDs on the breadboard will light up on the
is completed, you can navigate to the folder using side of the player in the lead. If both LEDs are lit up,
cd repsk-advanced and then run the game by you are tied. Each round will begin automatically,
typing sudo python 02_reaction_game.py. so keep going until you get too tired!
CREATE A
MONOPOLY
SIMULATION
Hack the board game of Monopoly by figuring out which properties are best to buy.
This tutorial simulates a game and figures out the winning squares
onopoly is a great board game that can be the Welcome to the world of discrete event
Youll M subject of many arguments. After playing the simulations. These are used to model all sorts of
The standard random number generator that is Then use a text editor, such as IDLE, to increase the
packaged with Python is not perfectly random, but value of nRolls by a factor of 100 or 1000 and rerun
is sufficiently random to be used for this project. It the program. As the number of rolls becomes very
generates numbers from a random series, which is large, the probability distribution function reported
initialised from a random number seed. If the seed is by the program approaches the theoretical probability
not set within the program, then a different seed is values for the different results of rolling two dice.
chosen each time the Python program that uses the The difference between the theoretical probability
library starts. values and the observed probability values occurs due
Rolling two dice can be simulated by running to statistical uncertainties. As the number of rolls
the randint function twice and adding the result increases, the statistical uncertainty on the resulting
together, where each randint function call produces probability distribution function drops.
an independent value.
The twoDice.py program simulates rolling two dice Modelling the board
100 times. The program contains a simple function The Monopoly board has 40 squares. A player starts
called rollTwoDice that calls the randint function from the GO square and then moves around the
twice, adds the return values together and returns the board in a clockwise direction until the game finishes.
result. When the program starts, it creates a list called Each of these squares can be given a number from
counters. This list has twelve elements set to zero. zero to 39, where the GO square is zero and the last
A floating point value is used in this list, since the square on the board is 39. As with the twoDice.py
final probability values are floating point numbers. program, the number of times each square is chosen
Once the list has been created, the program goes into can be counted using a Python list with 40 elements.
a loop calling rollTwoDice and recording the values The only other information that is needed is the
returned in the counters list. Once the simulated current player position.
dicehave been rolled 100 times, all of the counter A simulation of the Monopoly board without any
values are divided by the number of dice rolls. This other effects is given in the boardOnly.py program.
creates a probability distribution function for a total This program includes the rollTwoDice function,
value on two dice. as well as a function called plot. The latter uses the
Try running the twoDice.py program by typing: pyplot functions bar and show to produce a bar chart
that is shown on the screen. The pyplot function
./twoDice.py is part of Matplotlib. Therefore, before running this
program, the Matplotlib library must be installed.
0.030
0.025
0.020
0.015
0.010
0.005
0.000
0 5 10 15 20 25 30 35 40
GLSL SHADERS
THE COMPUTER LANGUAGE OF LIGHT
Make state-of-the-art special visual effects and animations
Youll for your video games and projects
Need ince the 1960s, computers have had graphic pixel without sacrificing performance. We can think of
> glslViewer
magpi.cc/
S interfaces: mouse pointers, windows, icons,
sidebars, all the things that are now common
shaders as the computer language of light.
So how do shaders work? And how are they different
2hNP4r3
onhome PCs. It hasnt been until the last few decades from other computer languages? Graphics are quite
> The Book of that video games have pushed the limits of visual hard for regular computer programs to process. Regular
Shaders
content on the computer. Video games have reshaped programs are written to be run on the CPU; they are
magpi.cc/
2nJ5dR2 the computer from the inside out, and one particular designed to do one task after the other like Python,
piece of hardware is responsible for the leap: the for example, where the program follows a list of orders,
graphics processing unit (GPU). Thanks to the GPU, one line at a time.
you can enjoy realistic 3D worlds with incredible Processing a digital image requires assigning a
cinematographic effects on them. GPUs can be colour to each pixel on the screen. Lets say you have
programmed, too: the small pieces of code that run on an old 800600 monitor: that requires around 480,000
them are called shaders. An example of this is the GLSL calculations. Now lets say your image is actually an
Shaders mod pack for Minecraft (magpi.cc/2ikJsEN). animation that needs to change 24 times per second
Shaders are a dry, C-like computer language designed to produce the illusion of movement. That is more
with the main purpose of rendering an image pixel by than 11,520,000 calculations per second enough
calculations to freeze a CPU.
A better solution
Thats why engineers came up with a different way
to process graphics on computers: they call it a GPU.
Youve probably heard it described as the graphics
card. The main design difference is parallelization.
The chip inside the GPU runs multiple tasks in parallel
at the same time, each one independent from the
others. In the first chapter of The Book of Shaders
(thebookofshaders.com), you can find a more detailed
explanation of this.
Learning how to program your own shaders
The GPU is like a lot of smaller
tubes that run in parallel is not simple, but it doesnt need to be hard any
more! You can find a program called glslViewer
nano shader.frag
#ifdef GL_ES
precision mediump float;
#endif
void main() {
gl_FragColor = vec4(1.0,0.0,1.0,1.0);
}
MIKES PI BAKERY
Veteran magazine author from the old
days and writer of the Body Build series.
Co-author of Raspberry Pi for Dummies,
Raspberry Pi Projects, and Raspberry Pi
Projects for Dummies.
magpi.cc/259aT3X
MAKE STUNNING
SCRATCH ART
Hack a DJ Hero turntable to simulate a harmonograph
and make intricate line art by scratching
his month were going to look at hacking
T an unlikely interface: we found a DJ Hero
Youll turntable at a local charity shop going
Harmonograph display
driven by the Raspberry Pi
Da GP C
Nunchuck oc PI
ta IO
The DJ Hero comprises a collection of buttons, knobs, >PYTHON 2
kI O3
+3
I 2C 2
Gn
2
Adapter a joystick, and a turntable. Fig 2 shows these controls
V3
d
labelled up as the functions theyre going to perform in DOWNLOAD
this project. The I2C address of this device is 0x52 and THE CODE:
consists of a number of registers. To initialise the device magpi.cc/1NqJjmV
on power-up, you must write the value 0x55 to register
0xF0. Note that each successive read will increment PROJECT
the address of the register read from. So, to read the VIDEOS
interface status, you need to set the register to zero and Check out Mikes
then read data six times these six bytes contain the Bakery videos at:
Fig 1 Wiring the Wii Nunchuk adapter to the Pi magpi.cc/1NqJnTz
information from the DJ deck. The assignment of bits
extension wires to it, or get a small Wii Nunchuk is shown in Fig3 overleaf, and at first sight looks a bit
adapter PCB and wire that to the Pi. Fig 1 shows the complex. However, this diagram has been simplified, in
wiring you need; as there are only four wires, you can that the DJ Hero is capable of having a second turntable
Fig 2 The full set of
use a length of ribbon cable to attach it to the Pi, with on the left-hand side, and the bits corresponding to this
controls on the DJ
the cover neatly clipping over the top. second turntable have been omitted. Hero controller
BIT BYTE was read. This is a five-bit signed value, with the most
7 6 5 4 3 2 1 0 significant bit being the sign bit. To be useful, this
must be converted into the sort of number that Python
TT 4:3 Save Joystick X 0:5 0 can understand, so bit 5 of the turntable number is
propagated to all the higher bits in the word; this is
known as sign extension. Also, for negative values, the
TT 2:1 Save Joystick Y 0:5 1 number must be in the ones complement format;
that is, with bits 0 to 4 inverted and 1 subtracted. This
format is universally used in computer languages and
TT 0 ROT 4:3 Redraw Depth 3:0 TT 5 2 prevents you from having two different bit patterns for
plus zero and minus zero, meaningless concepts.
TTB Turntable Blue Button 01. The Amplitude or extent of the swing
ROT Rotary - Not Used 02. The Frequency of the swing, determined
by the pendulums length
B- Invert Screen Button 03. The Phase of the swing, a fixed value added
to the frequency
B+ Select Parameter to Edit Button
04. The Damping or decay, which is the slow
RD Redraw Button reduction of amplitude as the friction takes
energy out of the pendulum
The buttons are simple: one bit in one byte of the The software
returned data block, and other controls are spread The code for this is DJArt.py and is written under the
over several bits. The two axes of the joystick are the Pygame framework. The drawing area is set by the
first six bits in the first two bytes, whereas the values screenSize variable, and you could make the window
from the slider are in bits 4 to 1 of byte number 2. The size larger simply by altering this value if you have a
rotary controls five bits are split up over two bytes, higher-resolution monitor. In addition, the window is
whereas the turntable is scattered all over the place in wider by 100 pixels given by the controlBar variable,
four locations. Youll need a bit of software to pull out in order to have room for the editable parameters.
the data you want from this block. The swing function is the one that actually draws the
The turntable returns a value, not of its position, path of the pendulums on the screen, with the points
but of the change in the position since the last time it calculated by the calcNewPoint function. Rather than
Taking it further
The only control not used is the rotary one. You might
like to try to add some code so that this controls
the thickness of the plotted line. Altering the short
variable value to a larger number alters the depth of
the pattern preview; you might like to make this bigger
if youre using a Raspberry Pi3, because it can draw
faster. You could also add software to change the colour
of the track according to the absolute X or Y position
or change it between two colours, either abruptly or
Fig 4 The control screen, and the result of different parameters
taken from the controller fading from one to the other over a length of track.
BUILD THE
and building fun, educational, and
practical things with the Pi!
magpi.cc/2bkQ53q
MARAUDERS CLOCK
Know when your family get home with this beautiful Harry Potter-inspired clock
e all love the many visual elements in the Harry of the devices you will be detecting on the network,
Youll W Potter movies, and this project combines two and substitute them into the code. It is important
> 2 5V mini
DCrelay
magpi.cc/
2lOere6
> Background
graphics
Continuous rotation servo to
give it a more clock-like feel
TESTING
THE CLOCK
MECHANISM
The clock
mechanism
can be tested
by connecting
digital input 1
on the Arduino
to ground.
Above The coil connectors of the relay are connected to 5V while True:
and output on the Explorer HAT Pro. The switch connectors are
connected to digital input 1 (and 2 for the second relay) and the
print("starting loop")
ground on the Arduino output = subprocess.check_output(
"sudo arp-scan -l", shell=True)
>STEP-04 print ("starting scan")
Connect the LEDs for i in range (len(address)):
We will be using four LEDs to light up different parts of if address[i] in output:
the Marauders map. Connect the short leg (cathode) print address[i]
to a common ground. Connect the long leg (anode) to print occupant[i]
digital pins 5,6,7, and 8.
The following LED pins are used: if "XX:XX:XX:XX:XX:XX:XX" in output:
#Person 1 MAC address
Digital Pin 5 = Person 2 explorerhat.output[0].on()
Digital Pin 6 = Away notification
Digital Pin 7 = Person 1 else:
Digital Pin 8 = Home notification explorerhat.output[0].off()
>STEP-05
Link the Pi and Arduino if "XX:XX:XX:XX:XX:XX:XX" in output:
Before connecting the relays, we will need to look at #Person 2 MAC address
the pin guide and identify the two pins for the coil and explorerhat.output[1].on()
the two pins for the switch. One side of the coil on
both relays should be connected to the 5V output on else:
the Explorer HAT Pro. The other side of the of the relay explorerhat.output[1].off()
coil should then be connected to output 1 and 2 on the time.sleep(60)
Explorer HAT Pro. The common switch connector on
both relays should then be connected to the common
CONNECTING
ground on the Arduino. The switch connector on the
THE RELAYS
first relay is connected to Digital 1 on the Arduino, and
the switch connector on the second relay is connected If the output
to Digital 2. We will be using the switch connector, from the relay
is reversed
which is activated when the relay receives power. (i.e. on when it
should be off),
>STEP-06 try swapping
the pole of
Assembling the project the switch on
We will need to download the code for the Arduino and the relay.
upload it to the Uno from here: magpi.cc/2lOfkTJ. We
then need to assemble our project. In our example we
have used a fruit box, but you could use an old clock, a
Left The Arduino,
cardboard box, or a hobby box. We need to (carefully)
Raspberry Pi,
screw clock hands to the two servos; take care not to and relays are
mounted on
move the servo as it can cause damage. Mount the
the rear of the
two hands so that that the continuous rotation servo case with long
jumper cables so
can move freely and the positional servo can move up
that the box can
and down. be opened
RASPBERRY PI
SECURITY
HOW SECURE IS THE RASPBERRY PI?
can easily encrypt the file system using a tool called
Password eCryptfs. Theres a good tutorial on how to do this,
Raspbian uses a default password that is quite well which can be found here: magpi.cc/2nv57wr.
known this is to allow kids to have easy access to
their Raspberry Pis. Other operating systems use HATs
different passwords and even force you to set a new There are a few HATs and add-ons that allow for
password after install. further security, privacy, and encryption on the
Raspberry Pi. These are very popular with enterprise
SSH users of the single-board computer and add a physical
By default, SSH is turned off on Raspbian. The default layer of protection to the Pi.
password and connection name are well known, so
SSH could let people snoop in on the Pi and find out ONLINE SECURITY
what youre doing. This can be turned back on very
easily using the configuration tool. Browser
The default browser in Raspbian is Chromium, which
Network is the base of Googles Chrome OS. Its quite secure,
Since Raspbian and most Raspberry Pi OSs are run and you can easily add pop-up blockers or extensions
on Linux, theyre very secure from the majority of that deal with malicious ads. Theres also the benefit
network attacks. Especially with SSH turned off or the that Raspbian runs on Linux, so website malware has
default server name changed, youre unlikely to find a less chance to affect your system.
problem day-to-day.
Scratch
HOW CAN I IMPROVE SECURITY? Online Scratch does allow you to create games and
programs and publish them anywhere, but there is a
Change password login system that allows you to access your projects
Changing the default password for your operating more easily. This can also be used to create a login
system is a good first step to adding further security to system in your Scratch game.
your Raspberry Pi: just make sure you remember what
it is! To do this, open the Terminal and type passwd. Python
Enter the current password and then the new one you Python is able to scrape data off the web, such as
want to use. weather or time or stock numbers. Be careful with the
online information you use and make sure its parsed
Encryption through Python, which can make everything into a
The SD card stores all your data, and this can be easy string of text. Try not to run this information outside
to read on other computers or Raspberry Pis. You the Python environment.
RASPBERRY PI
OS GALLERY
Take a look at every T he Raspberry Pi is amazing. Were probably a
little biased, but its hard to argue against it.
operating system
While the hardware is great, its important to
not forget the software that makes it so fantastic, and
at the very core of this is a good operating system.
available for the There are a fair few to choose from on the Raspberry
Pi. While youll be safe with Raspbian the vast
Raspberry Pi
majority of the time, theres plenty of choice if you
want to tweak your Raspberry Pi to be truly optimal
for your build or project.
Not sure where to begin? Have no fear, heres our
list of every current Raspberry Pi OS.
GLOSSARY
HARD FLOAT
Also known as armhf, this makes use
of the Raspberry Pis processor for
maximum efficiency. This is preferred.
SOFT FLOAT
If not using hard float, an OS for
Raspberry Pi is using soft float.
This type of OS doesnt use the
full hardware of the Pi and can
reduce performance.
DISTRIBUTION
A specific release of Linux, which while
not an operating system itself, can
become one with programs added
on top.
SPIN
A specific version of a distribution,
usually with slightly different
software included.
60 April 2017
2016 raspberrypi.org/magpi
RASPBERRY PI OS GALLERY Feature
RASPBIAN
The all-purpose operating system
INFO
ets start with the premier Raspberry Pi
L operating system, Raspbian. Its a specific
spin of the ARM version of Debian 7.0 Jessie
magpi.cc/2ejN6sk
RASPBIAN
While Raspbian does by default log into a desktop
environment, you can easily modify it to log into
WITH PIXEL
the command line instead. This option can be found
with several other options for enabling or disabling
services such as SSH and the Camera Module, making
it very easy to modify. This is the main release of Raspbian that you get from
the Raspberry Pi Foundation. It includes PIXEL (Pi
Improved Xwindows Environment, Lightweight) this
is basically a skin for the desktop environment, but its
very pretty and optimised for the Raspberry Pi.
It also comes with some extra flourishes like links
to Raspberry Pi resources in the menus (and a link
to TheMagPi!), as well as some of the Raspberry Pi-
specific software like GPIO Zero already installed. This
full-size version of Raspbian is the most popular and
the one the majority of tutorials will be written for.
RASPBIAN LITE
Lite is a minimal version of the Raspbian image for the
Raspberry Pi. This means it has less software installed
on it, and fewer modules will load with the kernel,
PROS CONS which results in the operating system using a lot less of
the Raspberry Pis resources. It will use less electricity
Official Raspberry Pi software S
D card image this way and perform a little faster for very specific
and hardware work best on it is on the larger side tasks, such as file servers or other uses where it never
Easy to use U
ses more resources needs to use a monitor.
raspberrypi.org/magpi April
April 2016
2017 61
Feature RASPBERRY PI OS GALLERY
General-use operating systems that around the age of 30, it feels right at
home on ARM chips, as thats what the
you can use for normal computer tasks old Acorn computers used to run on.
Its not super-useful for day-to-day
PI-TOPOS:
desktop tasks as it uses a lot of very
different software, but its great it exists.
INFO
crowdfunded less than two years ago. It a lot more angled towards learning to
has a huge educational focus and for that, the pi-top code than desktop use. This may be preferable if youre
team have created a special operating system called giving it to a young person, but for others looking for a
Built for pitopOS to go with the hardware. more pure desktop experience on Raspberry Pi, this is
pi-top computers It allows for easy access to coding apps maybe not the place to look.
like Python, and also includes lessons and
PROS CONS
Designed for education
worksheets to follow so you can learn Python.
Comes with CEED Theres also Minecraft Pi, Scratch, and Sonic
Universe educational Pi, just like on Raspbian. It also comes with Interface looks similar No access to extra
its own special educational game called CEED to smartphones Raspbian programming
game
Great learning resources libraries
Universe an RPG-esque game where you solve
Easy to hack with CEED Universe is great Not the best desktop
puzzles using code, along with puzzles that involve
experience
physical electronics. Its all set up with a universal login,
UBUNTU MATE
buntu is almost synonymous with Linux.
U Its one of, if not the most popular Linux
distributions out there and its managed to gain
ubuntu-mate.org
this reputation thanks to driving Linux-based operating
systems to be more user friendly.
PROS CONS
INFO
As well as the main version of Ubuntu, there are
several popular spins of it that use different
desktop environments along with other little Good software library Not as fast as Raspbian
Based on the very
tweaks and fixes, including Ubuntu MATE, Good desktop experience No access to
popular Ubuntu extra Raspbian
which uses the more classical-looking Easy to get
programming libraries
Debian core, like Raspbian MATE desktop environment. Its known for Well maintained
being lightweight and straightforward and
More of a pure desktop its gained popularity among the other spins work on the Raspberry Pi 2 and 3 and they have ample
experience on PCs for this very reason. power to run it well enough. Raspbian runs just a little
Its also the only desktop Ubuntu that works bit better, though.
Uses MATE desktop
on Raspberry Pi, and while known for being It doesnt have all the amenities of Raspbian either
environment
lightweight and fast compared to its peers on PC, no GPIO Zero, no built-in Scratch, etc. It does have
its relatively resource intensive on the Raspberry Pi. access to a wide range of software, though, and generally
Thats not to say it is bad and slow its designed to works a little better as a desktop PC.
62 April 2017
2016 raspberrypi.org/magpi
RASPBERRY PI OS GALLERY Feature
FEDORA
magpi.cc/2miaZUL
raspberrypi.org/magpi April
April 2016
2017 63
Feature RASPBERRY PI OS GALLERY
LIGHTWEIGHT
OPERATING SYSTEMS
Make the most of your Raspberry Pi with these slimmed down OSs
DIETPI MINIBIAN
magpi.cc/2mgkCDg
dietpi.com
esigned for embedded
D
Lighter than Raspbian Lite systems or server
Based on Debian Jessie Command-line interface
Very light graphical interface Based on Raspbian
over command line
Minibian takes a very similar approach to DietPi, although instead of offering
Claiming to be three times lighter than even a menu system like Whiptail, its gone full command-line interface with
Raspbian Lite, DietPi is a very stripped down the wayit works. Once again, its based on Raspbian and while it hasnt
version of Raspbian, albeit with more than just been updated in a year, the last release was created to make sure it was
a command line. It uses Whiptail menus very compatible with the Raspberry Pi 3.
simple graphical menus rendered in the CLI that Its very much designed as a release for people who want to use the
barely use any extra resources, and definitely use a Raspberry Pi as a server or an embedded system, the kind youd find more
lot less than a traditional graphical desktop. commonly in businesses than at home. It is also compatible with all of the
Being based on Raspbian means it does have Raspbian software as well, allowing it to be used like Raspbian itself if the
access to a lot of the great programming software need arises. This release probably isnt for everyone, though.
that comes with it including easy libraries for
controlling the GPIO ports with Python and such.
One of the unique aspects of DietPi is its task
PROS CONS
manager, which allows you to easily tweak the Great for servers and headless projects Command-line interface
priorities for different tasks running on your Pi Works with Raspbian software Niche appeal
particularly useful if youve chosen DietPi to make
sure certain tasks get as much power as possible.
MOEBIUS
It is also structured with certain types of project
in mind, providing automation features and a
comprehensive logging system. While this may all magpi.cc/2mgxJod
sound fairly advanced, its actually quite easy to get
your head around, while offering some easy-to-use Incredibly small Still hard float
advanced options. Designed for speed
Probably one of the smallest operating systems you can get for the Raspberry
Pi, Moebius boasts that you only need a 128MB SD card to install it, and that it
only takes up 20MB of RAM by default. The latest version is currently in beta
testing, which adds support for Raspberry Pi 3 (although at the time of writing,
the beta only works on Pi 3).
Its a much more extreme version of Minibian, even going so far as using
some components from Raspbian to make sure it still makes use of hard float
on the releases. Its an interesting OS, best suited to tasks that require as little
power and space as possible. Hopefully the newer version will also work on Pi
Zero for a truly minimal experience.
PROS CONS
Embraces being hiptail menus are not
W
PROS CONS
lightweight for everyone
Only needs a 128MB SD card Latest version still in development
Raspbian core Limited personal use
20MB RAM usage Extremely limited by default
in default state
64 April 2017
2016 raspberrypi.org/magpi
RASPBERRY PI OS GALLERY Feature
KIOSK AND
WEB BROWSERS
Looking to set up a public internet access point? Heres what could help
CHROMIUM
OS FOR ALL SBC
magpi.cc/2njuVeS
RASPBERRY
and other computers. The idea is its all cloud based, with storage via Google
Drive and an office suite with Docs and such. Its had varying levels of success,
WEBKIOSK
but as its built from the open Chromium base, it was open for being hacked a
bit to work on Raspberry Pi.
Chromium OS for Raspberry Pi works just like Chrome OS, which is great,
although it can be a little sluggish at times. For a web kiosk, you have to jump magpi.cc/2mgv3Xv
through extra hoops to get it working for multiple users. It seems more suited
for home then, perhaps as a kitchen computer for quickly accessing recipes. Free web kiosk software
Uses Chromium for browsing
Familiar interface Active development seems to have stopped This is actually two operating systems in one
Access to Google apps Tricky to modify for web kiosk use a pure, easy web kiosk OS for letting people
browse the web in your cafe or hotel or whatever,
and a digital signage version that is a touch more
raspberrypi.org/magpi April
April 2016
2017 65
Feature RASPBERRY PI OS GALLERY
HOME
ENTERTAINMENT
Whether you want to play some games or just watch some TV, theres a Pi OS for you
LIBREELEC
libreelec.tv
For a long time, OpenELEC was actually our Kodi OS of choice for the
OSMC
Raspberry Pi. Especially during the days of the original Raspberry Pi when
resources were at a premium, having as light an OS as possible to run Kodi
osmc.tv was great. Development has splintered a bit and LibreELEC has risen as the
successor to OpenELEC, with just enough OS for Kodi.
Built on Kodi core It runs an almost pure stock Kodi, with a few extra LibreELEC menus on
Previously RaspBMC top to handle extra settings and updates and such. It also has the benefit of
Uses custom interface by default being optimised for the new interface for Kodi, which is definitely a marked
improvement over the old one. Its still our preferred choice, especially on
Youll hear a lot about Kodi on these pages its the older Raspberry Pis and the Pi Zero.
media centre software used by many projects and
products that allow you to play back media on your TV.
Its an excellent core for any home theatre PC, so its
PROS CONS
great that OSMC not only uses Kodi, but is completely About as light an OS as possible Slower off the mark with new
up to date with the latest version. for Kodi Kodi releases
OSMC sets itself apart from stock Kodi by using Great update system AirPlay doesnt work well
its own interface as default, trying to make it easier
to navigate your media or add it in the first place.
XBIAN
Compared to its main alternative, LibreELEC, its
a little heavier resource-wise, although it doesnt
make a difference in terms of actually playing xbian.org
your media. Itll run 1080p video with ease and is
compatible with a huge array of codecs. Veteran Raspberry Pi OS
Based on Debian Has a custom installer
PROS CONS One of the original Kodi OSs on Raspberry Pi, Xbian has been around for
Kodi base New default Kodi skin nearly five years. It offers a stock Kodi experience on a pared-down version
Playback is as good possibly better of Debian/Raspbian, which means you can then install other software
as the Pi can handle Fewer ties to Kodi dev underneath Kodi if you so wish. On the original Raspberry Pis this was a little
team than LibreELEC risky as you only had limited resources, but with the Pi 2 and Pi 3 theres a bit
more power to make use of.
Xbian still retains this ability, as well as being packaged with an easy-to-use
installer that automatically burns an SD card for you. It gives you a bit more
flexibility this way, in exchange for some optimisation, although youll only
notice issues on original Raspberry Pis and Pi Zero.
PROS CONS
Kodi base Heavier than other Kodi OS
Easy install system Not great on Pi Zero
66 April 2017
2016 raspberrypi.org/magpi
RASPBERRY PI OS GALLERY Feature
SLAXBMC
magpi.cc/2mgp451
PIBOX
for building up the exact operating system you want. SlaxBMC is an excellent
example of this: a Kodi OS for Raspberry Pi built on Slackware. You dont have to
build it from scratch yourself, though: you can just grab the image and burn it to
an SD card to use straight away. magpi.cc/2mgsIMk
SlaXBMC is a bit different in that it also lets you log into a standard graphical
environment by exiting Kodi. This way you can turn your Pi into a living room Media server system
PC if you wish. However, this does mean that it has a much larger image and Aimed more at business
uses a few more resources than other Kodi builds. Back-end server and front-end player system
RETROPIE
Less easy to set up
Same software for both ends
of media playback
retropie.org.uk
Easy to set up
Retro game player
Emulates tons of consoles and old PC games
The premier retro game emulation software for Raspberry Pi, RetroPie is
the heart of many retro gaming projects. It allows emulation of basically
everything pre-SNES and a few things after it, along with arcade games and
some PC stuff like SCUMM. It did start off a little rough around the edges, but
over the past couple of years it has sharpened up to become an amazing and
easy-to-use piece of software.
It also includes a few features for making sure it is kept up to date, and
even supports netplay between RetroPie devices. No media playback at the
moment, though (although it is being tested), so its purely for games.
PROS CONS
Very easy to set up No traditional media playback yet
Extensive list of emulators Need to source your own games
raspberrypi.org/magpi April
April 2016
2017 67
Feature RASPBERRY PI OS GALLERY
PROVIDING
A SERVICE
Cloud, server, or Docker heres a selection of operating systems for different utilities
RASPBERRY PINET
OWNCLOUD pinet.org.uk
RESINOS
resinos.io
MOTIONEYEOS
OS for containers magpi.cc/2nqLuFT
For Docker and dev work
Powers resin.io CCTV software
Allows for remote monitoring
Docker and containers are excellent development and Motion activation features
deployment tools, allowing you to test out different
scenarios on different installs that are almost like virtual Weve used motionEyeOS in the past for a couple of projects and its
machines. ResinOS is an operating system for Raspberry a great little operating system for any project that requires remote
Pi that allows you to use and create containers for access to a camera. Whether its full-on CCTV or just watching your cat
Raspberry Pi installs. Its an excellent tool if you like to flap, its got a lot of great features to make sure all your surveillance
use more advanced Linux and programming methods. needs are
satisfied.
It works with
the official
Camera Module
as well as USB
webcams,
and supports
multiple
input streams.
68 April 2017
2016 raspberrypi.org/magpi
RASPBERRY PI OS GALLERY Feature
NARD SDK
INTERNET
magpi.cc/2nqWK4K
WINDOWS
has auto-repair tools for the SD card file system. It even
emulates Raspbian if you need it to.
10 IOT CORE
magpi.cc/1qOEEb1
Kali has a reputation as one of the better pen An ultra-lightweight version of Ubuntu that can be
testing Linux distros, aimed at helping people find used for IoT, but also for embedded systems, cloud
vulnerabilities in their systems. Portability of Kali is servers, and more. As its Linux, it may be more
pretty key, so a Raspberry Pi with Kali installed is a familiar to people who are already programming
great tool for checking network vulnerability issues and using Raspberry Pi in their projects. Its well
as well as problems with individual machines. The supported and full of great software packages.
Raspberry Pi image is a streamlined version of Kali,
ANDROID
but there is a full version you can install if you need it.
THINGS
magpi.cc/2nqUFGi
raspberrypi.org/magpi April
April 2016
2017 69
Tutorial WALKTHROUGH
RASPBERRY PI
PROJECTS BOOK
Amazing hacking and making projects
from the creators of magazine
Inside:
How to get started with Raspberry Pi
able
Availw
no
magpi.cc/MagPiStore
plus all good newsagents and:
Maker
Says
A buffet
of sensors,
inputs, and
displays
to explore
Android
Things
Pimoroni
RAINBOW HAT A versatile HAT to try out Android Things or use with Python
riginally known as Project and blue respectively). The most Alternatively, like us, you can import
O Brillo, Googles recently
relaunched Android Things
visually impressive feature is
the SPI-operated rainbow arc
one of the example projects from
the Android Things GitHub repo
operating system is designed to of seven super-bright APA102 (magpi.cc/2mFNxTe). The first time
be used with IoT devices including RGB LEDs that gives the HAT you do this, youll be prompted to
24 / $25
we soon noticed it rising. As usual the rainbow arc and showing AHOY,
with a board-mounted sensor, this YARR or GROG on the alphanumeric
is due to the heat from the board display depending on the capacitive
and the Raspberry Pi just below button pressed! Other examples
it, but you could always calibrate include a temperature gauge and an
it by comparing the real ambient RGB/HSV lamp whose shade is set
temperature (using a standard using the touch buttons.
thermometer) to discover the A look at the library example code
average difference. A press of a or the getting started tutorial at
button switches the display to magpi.cc/2lX6Jih reveals a simple
pressure, which is also indicated by syntax for using the HATs features,
112 / $119
Maker
Says
Fully
compatible
hardware
and software
Western Digital
WD PIDRIVE
COMPUTE CENTRE
Build a Raspberry Pi computer with a 375GB hard drive
estern Digital has The lid comes with a magnetic of BerryBoot alongside its
W been bringing its hard
drive range to the
top, so its securely slotted to
enclose the drive, but can be
Foundation Edition Software
(magpi.cc/2ns5lnA). BerryBoots
Raspberry Pi thanks to a series of quickly removed to access the boot selection screen makes it
Related
PiDrive devices. Pi and hookthe GPIO pins up to easy to add multiple operating
These combine the Raspberry electroniccomponents. systems to your Raspberry Pi, and
Pi microSD card with a larger WD the ample storage gives them
OFFICIAL hard drive to provide a Pi with a Foundation Edition space to breathe.
STARTER beefed-up storage system. Its the Foundation Edition software We added Ubuntu Mate 16.04,
KIT The WD PiDrive Computer that makes this system sing. OpenELEC, and RetroPie, all
If you want a Centre features a Raspberry Pi3 It would have been easy just to alongside Raspbian. Each OS had
Raspberry Pi
and a WD PiDrive Foundation produce a kit that uses the hard plenty of space for files.
computer kit
but you're not Edition 375GB package. You drive as an external drive to a All in all, we liked this kit.
interested in also get a wireless keyboard and regular Raspberry Pi. Adding a large hard drive
the larger hard
mouse and a plastic case to hold However, WD has taken the time transforms the Raspberry Pi, and
drive, then
take a look both the Raspberry Pi and WD to produce a custom edition of its all enclosed in a nice mini
at the official hard drive. NOOBS that works directly with the desktop-style case.
kit instead.
Assembling the hardware main drive.
provedeasy enough. Simply screw You select SDA1 during the Last word
the Raspberry Pi board to the base installation process, and it walks
A lovely piece of kit that
of the case and then screw the through the process of installing
offers excellent Raspberry
hard drive in next to it. A USB cable Raspbian with PIXEL. From then
Pi integration with a larger
splits out to provide power to the on you have a version of Raspbian
hard drive.
Raspberry Pi and the hard drive. running on the full 375GB hard drive.
99 / $139
Included are a power adapter and Not only that, but WD has
magpi.cc/2nrY33i
all cables. produced a custom edition
JUSTBOOM
DAC HAT
Music sounds better with a HAT on
he JustBoom range of Pi The DAC HAT comes pre- use, although we found we needed
T products comprises three
main types DAC, Amp,
assembled, so you just need to
mount it securely on the Raspberry
to boost the digital volume in
alsamixer for headphone playback.
and Digi featuring different sets Pi using the supplied plastic spacers One final trick up the DAC HATs
of outputs for different uses. Each and bolts. As well as slots for sleeve is the ability to stack a
Maker
Says
High-
definition,
low-latency
video capture
for the
Raspberry Pi
Lintest Systems
PICAPTURE HD1 Capture video using your Raspberry Pi with this inexpensive capture card
that also doubles as a HAT
his is a very interesting This is important, as the CSI has a creative balancing (its quite a bit
T
Related
kit/HAT for the Raspberry direct (and very high bandwidth) wider than the Zero is), you could
Pi. Video capture usually connection to the main BCM probably get it to work. With the
requires machines that offer a chip on the Raspberry Pi, which form factor the way it is, though,
FEBON100 decent amount of power so they contains VideoCore. Installed like a youd be better off with an A+.
UVC CVBS can stream or convert an input HAT on the Raspberry Pi, PiCapture With the hardware all attached,
There are a few signal into a video. However, draws power from the GPIO ports, you can then record your video
USB capture due to the way the PiCapture is and can connect via I2C or UART. It input. As this is done through
cards that will
built and optimised, it connects also handily extends the GPIO pins the camera connector, you can
work with the
Raspberry Pi, straight to the Raspberry Pis above the board so you can use use Camera Module software to
although these VideoCore graphics processor, and them for other tasks. preview and record the video; no
dont support
is able to make full use of it for Its an incredibly neat and extra software needed! Its an
very high
resolutions. video capture. well-thought-out design, and incredibly smart way to do it as it
This is the HD version of the because VideoCore is the same also means its instantly usable in
PiCapture, which supports input in all versions of the Raspberry Python for more advanced projects
via HDMI and component video. Pi, it will work on any Pi with a and uses. A typical use would be to
The HD and SD versions share 40-pin GPIO port even a Model record video, and show a preview
the same connection to the Pi A+. Raspberry Pi Zeros arent at the same time, so that you can
62/$77
through the GPIO ports, and via included on the spec sheet, but watch the preview on your monitor
magpi.cc/2moR0s8
the camera connector (CSI) port. with a little modification and some or TV during recording.
130 / $159
PYTHON
than starting with control flows.
APRESS
then install in the cloud
TECHNOLOGY Author: Paul Barry at PythonAnywhere, to
IN ACTION Publisher: OReilly
Price: 39.99
support the web app you
write with Flask. Difficult
ISBN: 978-1491919538
Apress brings a diverse range of maker magpi.cc/2nfiscb subjects like decorators,
topics to its Technology In Action series comprehensions, and
Whether or not generators are painlessly
you like the introduced, as our app is
CRAFTING WEARABLES: quirky, visual constantly refactored, and
BLENDING TECHNOLOGY style of OReillys Head communicating with an SQL
WITH FASHION First books, this is an excellent database is carefully taught.
introduction to Python, well written PEP8 gets an early mention, but
Author: Sibel Deren Guler
and well paced. Aimed at those with otherwise testing is left. Nor is there
Publisher: Apress
Price: 22.99 at least a little coding experience anything on Jupyter or doing data
ISBN: 978-1484218075 in another language, Paul Barrys science, for example, but this is a
magpi.cc/2nfbQKS text starts iconoclastically by book that teaches a lot, very quickly,
sidestepping Hello World, and and confident learners who find
Gulers scattergun approach to diving into a more in-depth first other introductory books too slow-
this diverse topic has interesting
facts and ideas in every section. program, bringing in the list data paced will get a head start in Python
It touches on the elementary structure, importing from the with this Head First guide.
skills you need, leaving you with standard library, and introducing
more questions and the urge
the powerful in operator.
Score
to find the answers.
The data-first approach, with
lists, then dictionaries, tuples,
BEGINNING FPGA:
TMUX 2
PROGRAMMING METAL
a terminal or virtual console. Your
Author: Aiken Pang
mouse is slowing you down,
PRODUCTIVE
Publisher: Apress
says Hogan. Keyboard-controlled
Price: 29.50
environments mean you dont have
MOUSE-FREE
ISBN: 978-1430262473
magpi.cc/2nfkUPK to break concentration on typing as
DEVELOPMENT
you switch between tools.
If you want to really grasp tmux allows multiple windows
logic gates, computer
hardware, and close-to-the- Author: Brian P Hogan
of command-line sessions,
metal programming, field- Publisher: Pragmatic as well as dividing up
programmable gate arrays Bookshelf the terminal window
are your path to enlightenment.
Price: 17.50 into panes like a tiled file
Challenging but fun.
ISBN: 978-1680502213
manager. tmux sessions
magpi.cc/2nf9jQO
can exist independently of
RASPBERRY PI GPU An 80-page book on the terminal running them,
AUDIO VIDEO a command-line reattaching them to your shell
PROGRAMMING tool might seem as required great for running
a negligible product, but when you on headless Raspberry Pis or
Author: Jan Newmarch
see its from Brian Hogan, author of web servers, where you may want to
Publisher: Apress
Price: 22.99
Exercises for Programmers (five-star leave quite complex command-line
ISBN: 978-1484224717 review in The MagPi #42), you know sessions running after you log out of
magpi.cc/2nfenEA that its claims to make you more SSH. Theres plenty more to tmux,
productive are worth investigating. as Hogan outlines, from scripting to
The missing manual for GPU
If youre used to tabs in browsers pair programming. Try it and boost
programming on the Pi
particularly with OpenMAX or terminals, youll be familiar your productivity.
and OpenVG. Youll need a with doing more than one thing
reasonable grasp of C, but
within a window. tmux is a terminal
Newmarch gives you everything
else. Very code heavy. emulator which lets you do several Score
command-line tasks within
and in particular a modified selfie Score with great examples, and practitioner
interviews. For any product youre planning.
stick. Dot can talk to tech, as well
Learning React
PROGRAMMING triangle generator opens each
Author: Kirupa Chinnathambi
LANGUAGE
Publisher: Addison-Wesley
chapter, giving a useful starter in Price: 24.99
each languages style and approach. ISBN: 978-0134546315
THE MONTH IN
RASPBERRY PI
Everything else that happened this month in the world of Raspberry Pi
Top The venue for the party was the Cambridge Junction, a
classy building that just about housed all the festivities
Middle Pi-powered games and gizmos were everywhere at the
The official cake of the party changed colours as you party, like this giant game based on Operation
tweeted it! There was a real cake, though. It was yummy Bottom Foundation CEO Philip Colligan gave a keynote speech
on the Raspberry Pi
Code Club was well represented at the party our stall was right next to theirs! Eben enjoyed the face-painting stall
AUDIO VISUAL
This robot face tracked your movements. It was a little spooky
Want to see more from the party? You can catch a
glimpse of the talks and activities in the Big Birthday
Weekend video, on the Raspberry Pi YouTube account
here: magpi.cc/2mAard6. You might even spot The
MagPi team
PI VS PIE
Whats best on Pi Day?
The Raspberry Pi or a raspberry pie?
MAGPI
not only because of the name but also because of
the STEM connotations. This year, Raspberry Pi
illustrator Sam Alder and The MagPi contributor
Alex Bate put together a very important list,
showing the differences between pies and Pis. No
one should go without reviewing its contents.
BEST PIES
We asked the Twitter followers
of The MagPi the most improtant
44% 24% 17% 15%
question of all: what is your favourite
CROWDFUND THIS!
The best crowdfunding hits this month for you to check out
SWITCH
magpi.cc/2nvTEMU
BOOTH
INSPIRING
kck.st/2lZkKst
Did you manage to get a
Nintendo Switch? Dragging
yourself away from Zelda to
read the mag? Well it seems
that Nintendo of Americas PR
department likes the Raspberry
There are many ways to use LEDs with the Raspberry
Pi, as it powers their Switch
Pi, and Alex Eames has come up with yet another
kiosks that can be found in
excellent idea for how to use them: by creating strips
stores across the US.
and shapes of LEDs that can be attached in different
ways and used to easily build up a project in any way
PIMAC
you desire. Its already hit its goal, so its a good time magpi.cc/2nw3oXK
to help fund it further and get your hands on some.
magpi.cc/2nw46Es
RASPBERRY PI WINDOWS
98 WATCH
WATER GUN This may be pretty daft, but
kck.st/2nleu1J goodness is it also amazing?
In an era of crazy Apple and
Ever wanted a fun Raspberry Pi kit that teaches you Android smartwatches, lets
coding, making, and gives you an excellent prank at the bring it back a step back to the
end of it? The Raspberry Pi Water Gun is a kit you can 1990s and power a smartwatch
build that lets you create a trap that squirts would-be with the venerable Windows 98.
pranksters with water. Its fun and daft and we love the 20 years old now, and available
idea, so head on over to the Kickstarter if you want to to run slowly on your wrist.
give it a hand.
COMMUNITY
PROFILE
BEN
CROSTON
Ben Croston If you have ever used Python to control the
GPIO pins then you have Ben to thank,
Category: Maker
as he created the RPi.GPIO library
Day job: Brewery owner
Website: magpi.cc/2n16xey
B
en has always been a As Ben frequently mentions during
twitter.com/CrostonBen maker at heart. For his our chat, Brewing is scientific
first project he created and it requires a high degree of
a home automation system while consistency in order to reproduce
still in school, and learnt to build the same beer time and again.
a robot in the late 1980s, using So how can technology help
one of the Usborne books and a the process? Ben has employed
BBC Micro! a Raspberry Pi to manage the
Ben Croston loves to brew heating system used to brew the
beer. In fact, when he took beer. It provides a web interface
voluntary redundancy from for remote access and monitoring
British Aerospace he saw it as of the temperature in the hot
his chance to take a passion and liquor tank. This uses a DS18B20
turn it into a business. At British temperature sensor, the same
Aerospace, Ben had worked on sensor that is used in the CamJam
data acquisition and simulation Edukit #2. It even provides a fail-
systems using engineering safe option to ensure that the
principles and knowledge to trick water is maintained at the correct
the avionics of an aircraft to think temperature all part of the
that it was flying while recording complex brewing process.
the data for later analysis. His original idea was to use
So when Ben took voluntary RPi.GPIO to control the heaters
redundancy, coincidentally just as and motors using a series of
the Raspberry Pi was first being sensors. Ben has plans to add
announced, it was natural for further Raspberry Pis to his
him to think about the brewing brewing systems, including the
process and how it could be fermentation system. It takes
improved using technology. a week for the natural sugars
HIGHLIGHTS
PI PARTY BEER
Every year for the Raspberry Pi Birthday Party, Ben
brews a special recipe beer called Irration Ale. This
beer is only for the party and is provided free of
charge to the adults at the evening event. Its nice to
know that we are celebrating with a product that a
Raspberry Pi has helped to create.
magpi.cc/2n14qaw
RPI.GPIO
The original library that has powered hundreds
of thousands of Python GPIO projects around the
world. Created as a means for Ben to interface
his brewing equipment with the Raspberry Pi to
ensure consistent brewery practices, this library
has helped many to realise their own physical
computing projects with Raspberry Pi and Python.
EARLY ADOPTER
Ben has always been tinkering with hardware, even
when he was at school. Here (left) we see Ben with his
own version of an early home automation system, which
used 1990s PC technology and a series of transistors to
Ben shows off his first GPIO project, from more
control the power to a number of mains outlets.
than 20 years ago: a home automation system
KEEPING YOUR
HAT OPEN
Is there a way to use only open-source tools to design and manufacture Raspberry Pi
accessories? Leon Anavi was determined that there should be for his Pi HAT
PI HAT?
World! program of the hardware professional proprietary software,
world, used in our issue 42 tutorial. but as Leon wanted to work
While you can breadboard the entirely with free and open-source
circuit for your idea, to test it out in software, his first choice was KiCad. A Pi HAT is a board that sits on top of the Pi plugging
HAT format, the best way to try out This choice was influenced not into all of those GPIO pins to add extra functionality.
your idea is by using an Adafruit just by the advantages outlined in HAT stands for Hardware Attachment on Top, as well
Perma-Proto HAT. the KiCad box (overleaf), but by as referring to its position atop the Pi board. The more
Youll need an EEPROM if you local hardware company Olimex you spend time with computer scientists, the more
want to conform to HAT standard. developer of the TERES-I DIY you notice their love of (usually very bad) puns.
Leon outlined the device tree, laptop [see our FOSDEM coverage The HAT spec was introduced along with the
originating in open firmware, which in The MagPi #55] being heavy expansion to a 40-pin GPIO with the Pi Model B+ in
is used to describe the hardware users and supporters of KiCad, 2014, followed by frenzied discussion on the correct
using key-value pairs in a tree of and running some workshops in pronunciation of EEPROM. Third-party, commercial
nodes. The device tree is found in all its use. A particular influence was HATs were swiftly introduced. The best travelled is the
modern ARM devices. The CAT24C32 local KiCad expert, Rangel Ivanov, Sense HAT, which made its way to the International
is the recommended EEPROM: who also helped with Leons next Space Station, carried by Tim Peake, and runs code
an 8-pin DIP, talking to the I2C project (described later). developed by UK schoolchildren.
interface. Flashing the chip takes a When trying something out for Pi HATs must follow official specs to use the
few simple steps, from the software the first time, particularly in a name HAT: a form factor to fit on top of the 40-pin
point of view, but you do need a new field, never underestimate GPIO header, on a 65 by 56mm board, and with
suitable device. As befits a hobby the utility of having someone local an EEPROMcontaining a device tree fragment,
project, Leon made his own EEPROM you can turn to for help whether identifying the board to the Pi. You can see the full
flasher, using a breadboard to attach their mentoring is just a reassuring details at: magpi.cc/1OAHaGk.
pins 3 and 5 of the EEPROM to GPIO presence, or detailed debugging HAT templates are freely available for KiCad and
2 and 3 for flashing, and to GPIO 27 assistance. The range of help given Eagle, saving plenty of time over transferring the
and 28 to read it back [see picture] within the Raspberry Pi and wider outline dimensions and connector holes from the Pi
accomplished here by moving it maker community is something we Foundation specification document.
from the left side to the right side of find quite inspiring. Another useful site is pinout.xyz/boards which lists
the breadboard, powering off the Pi Leon acknowledges plenty of HATs and pHATs, with details of the pins that they use.
in between. help in creating his first DIY HAT.
Nevertheless, he claims to have know just how smart he is), and software examples were written
repeated a lot of common mistakes its something to be remembered using the wiringPi library and
along the development path, from when you encounter problems LIRC. As a C coder, Leon was
not complying with recommended along the way in developing your slightly taken aback by the demand
trace space sizes, to placing a own board. for example code in Python, but
component a potentiometer - To get the prototype board provided it using RPi.GPIO
where it could be shorted out by made, Leon chose the US company along with C examples, and even a
the Pis HDMI connector when the OSH Park, widely used in the user manual, with all of it released
HAT was moved slightly by users maker community because of its under open-source and Creative
pressing the button mounted on it. combination of excellent quality Commons licences.
Its always quite comforting to and relatively low prices, although Its a neat little board, very
hear about smart people making cheaper Chinese alternatives are useful not just for that weather
some of the same mistakes as available. Leon later looked for station application without
the rest of us (if you are in the a local manufacturer, giving the the temperature measurement
Tizen or Yocto communities, added advantage of quick shipping. being skewed by processor
youll have encountered Leon, and load, but a good board for
Complete package general experimentation across
Originally called the RabbitMax electronics, embedded hardware,
Flex HAT, legal complications and the ubiquitous Internet of
led to it being renamed as the Things. It is useful if you have an
ANAVI Flex. This Raspberry Pi idea youd like to try out and you
HAT includes an IR photo sensor, want to get started without having
RGB and IR LEDs, a slot for an to build the hardware for it.
LCD character display, and a Following feedback on the
usefully specced relay (rated at prototypes, small revisions
10A, 250V), as well as slots for up were made, and a low-volume
to five plug-and-play I2C sensors - manufacturing run was released and
KICAD
anything that i2cdetect works with quickly sold out. The next step was
shouldnt give you any problems. a crowdfunding campaign, which
During September last year, as led to a successfully funded larger
One of the tools essential to creating a new prototype boards were distributed manufacturing run and to Leon
prototype board is a CAD computer-aided design to bloggers and developers, trying his hand at designing a pHAT.
program. Traditionally, these have been niche,
expensive proprietary products, but one freeand
Below On a
open-source alternative, KiCad, has long been full-size Pi, and
highly rated. mounted with
I2C sensors, the
Handling up to 32 layers, KiCad also features a Infrared pHAT is not
push and shove router to clear traces out of the just an IR receiver/
transmitter, but
way as you draw a new track, or reroute the track also a humidity/
when that is not possible. A rotatable 3D viewer temperature/
light sensor
enables a clearer picture of the results of your
design decisions. KiCad is also a complete suite
for electronic design automation (EDA), covering
everything from schematic capture to a bill
of materials.
The project has received generous development
sponsorship, including from CERN, which
introduced the push-and-shove router capabilities.
The Raspberry Pi Foundation has itself donated
to the CERN and Society Foundation, for the
development of KiCads differential pair routing and
track-length control features.
The KiCad forum on the website features several
HAT discussions and tips. Also of interest is the
showcase of projects created by KiCad users:
magpi.cc/2mjcIJt
Phat pHAT slots for sensors: temperature and Leon wanted to continue with
Most readers will be familiar with barometric pressure (BMP180), the open-source workflow in the
the Pis HAT accessories see the temperature and humidity new project, but was also keen to
Pi HAT? box if you are not but (HTU21), and light (BH1750). see manufacure take place locally.
those who dont use the Pi Zero may As an IR controller, it is close to We ask him how hes got on. I
have missed the arrival of the HATs plug-and-play, simply snapping established a contact with a local
smaller, and unofficial, cousin. A into place, and coming with sample manufacturing company, he
pHAT is a partial HAT, lacking the applications that make it easy to replies. So it is going to be an
full, offical Pi HAT specification. In run on Raspbian. If you want to open-source hardware product
particular, few have the EEPROM, go deeper into the software, both entirely designed, manufactured
and the size is smaller, matched to Leons add-ons support his IoT and assembled here in my
the Pi Zero (65 by 30mm, with four GNU/Linux distribution, which hometown of Plovdiv, Bulgaria.
mount holes). They can be used with is based on Poky. Built with the Of course, the design is done with
free and open-source tools only,
RASPBERRY JAM
EVENT CALENDAR 4 NEVERS
RASPBERRY JAM
Nevers, France
Find out what community-organised, Raspberry Pi-
themed events are happening near you
FRANKLIN TOWNSHIP
3 RASPBERRY JAM
Franklin Township,
NJ, USA
FIND OUT
ABOUT JAMS
Want a Raspberry Jam in your MELBOURNE PI
area? Want to start one? 1 USER GROUP
Warranwood,
Email Ben Nuttall about it: VIC, Australia
ben@raspberrypi.org
6 MANCHESTER
RASPBERRY JAM
Manchester, UK
2 QUANTUM TECHNOLOGY
CLUB
Ormskirk, UK
COULD USE
MORE JAMS
STAFFORD
8 RASPBERRY JAM
Stafford, UK
7 TAUNTON
RASPBERRY JAM
Taunton, UK
TAUNTON
RASPBERRY JAM
When: Sunday 9 April
MORE WAYS TO LEARN
SHOULD YOU START A CODE CLUB?
Where: Taunton Library,
Taunton, UK
magpi.cc/2mwTTm8
More chances to get hands-on Code Clubs are amazing
with more digital making activities places for kids to learn how
through workshops and a hackspace to code, but dont just take
area to share projects. our word for it listen to
the kids that go to them
STAFFORD RASPBERRY JAM with the latest video on
When: Tuesday 11 April the Raspberry Pi YouTube
Where: Stafford Library, channel: magpi.cc/2nrY9IC.
Stafford, UK Our favourite quote is
magpi.cc/2lzwyQu it makes me all excited
A big meet-up of Pi enthusiasts inside, which is an excellent
where they all share ideas, help reaction to digital making.
each other, and most of all To find out more, go to
have fun! codeclub.org.uk
Wireless worries
I was very excited to hear about the new Raspberry
Pi Zero W when it was announced. Ive been
wanting integrated wireless on the Pi Zero since
it came out! I was surprised to see a very different
type of antenna, though, compared to the Raspberry
Pi3. While it does look very intriguing, I am worried
about how good it is as an antenna compared to the
older one? Surely a little bit of cut-out board cant
be as good? Hope you can allay my fears.
Les Bourne
Three cute project kits for the Raspberry Pi Zero W. Solder and assemble,
then connect and code them to make them unique to you.
FREE
IN PRINT AND DIGITAL
FIND US ONLINE:
www.helloworld.cc
@HelloWorld_Edu
fb.com/HelloWorldEduMag
raspberrypi.org/magpi xxxxx
April 2016
2017 95
Column THE FINAL WORD
MATT RICHARDSON
Matt is Raspberry Pis US-based product evangelist. Before
that, he was co-author of Getting Started with Raspberry Pi
and a contributing editor at Make: magazine.
MAKING
ART
WITH CODE
Matt Richardson delves into the world of Processing,
the programming language for visual artists
ne way we achieve our mission at the Physical process
O Raspberry Pi Foundation is to find an
intersection between someones passion and
Processing is especially cool on the Raspberry Pi
because theres a library for working with the Pis
computing. For example, if youre a young person GPIO pins. You can therefore have on-screen graphics
interested in space, our Astro Pi programme is all interacting with buttons, switches, LEDs, relays, and
about getting your code running on the International sensors wired up to your Pi. With Processing, you
Space Station. If you like music, you can use Sonic Pi could build a game that uses a custom controller that
to compose songs with code. This month Id like to youve built yourself. Or you can create a piece of
introduce you to some interesting work happening at artwork that interacts with the user by sensing their
the intersection of computing and visual arts. proximity to it.
Processing is a programming language and Best of all, Processing is created with learning
development environment that sits perfectly at that to code in mind. There are tons of built-in
intersection. It enables you to use code to generate examples that you can use to learn about many
still graphics, animations, or interactive applications different programming and drawing concepts.
such as games. Its based on the Java programming The documentation on Processings website is very
language and runs on multiple platforms and thorough and like Raspberry Pi theres a very
operating systems. Thanks to the work of the supportive community around it if you run into any
Processing Foundation, and in particular contributor trouble. Additionally, the Processing development
Gottfried Haider, Processing runs like a champ on the environment is powerful but also very simplified.
Raspberry Pi. For these reasons, its perfect for someone who
When I want to communicate how cool Processing is just getting started.
is while speaking to members of the Raspberry Pi To get going with Processing on Raspberry Pi,
community, I usually make this analogy: with Sonic theres a one-line install command. You can also go
Pi, you can use one line of code to make one note; to Processing.org and download pre-built Raspbian
with Processing, you can use one line of code to draw images with Processing already installed. To help you
one stroke. Once youve figured that out, you can use on your journey, theres a resource on Raspberry Pis
computational tools such as loops, conditions, and website for getting started with Processing. It includes
variables to make some beautiful art. a walkthrough on how to access the GPIO pins to
And even though Processing is intended for use combine physical computing and visual arts.
in the realm of visual arts, its capabilities can go When you launch Processing, you will be presented
beyond that. You can make applications that interact with a blank file where you can start keying in your
with the user through a keyboard or mouse input. code dont let that intimidate you. All of the worlds
Processing also has libraries for working with network greatest pieces of art have started with a raw slab
connections, files, and cameras. This means that you of marble, a blob of clay, or a blank canvas. It just
dont have to create artwork with Processing. You can takes one line of code at a time to generate your
also use it for almost anything you need to code. ownmasterpiece.
ESSENTIALS
LEARN | CODE | MAKE