The.MagPi.TruePDF-April.2017.pdf

(23984 KB) Pobierz
THE
OFFICIAL
RASPBERRY PI MAGAZINE
The official Raspberry Pi magazine
Issue 56
April 2017
raspberrypi.org/magpi
RASPBERRY PI
INCREDIBLE
PROJECTS
Get started with digital making today
POWER UP
The safest ways
to power your Pi
The terminal will
help you, if you know
how to ask
HOT STUFF!
Build an LED
thermometer
AMAZING ART
WITH PYTHON
Use a DJ controller
to mix a masterpiece
Also inside:
>
CELEBRATING 5 YEARS OF RASPBERRY PI
>
SIMULATE MONOPOLY TO BUY WISELY
>
BUILD A SIMPLE REACTIONS GAME
>
LEARN THE LANGUAGE OF LIGHT
EVERY
OPERATING
SYSTEM
TESTED!
Find the right Raspberry Pi
distro for the right task with
our 10-page super-test
Issue 56
Apr 2017
£5.99
THE
ONLY
MONTHLY MAGAZINE WRITTEN BY AND FOR THE PI COMMUNITY
Welcome
WELCOME TO
THE OFFICIAL
MAGAZINE
incredibly important. Whether you’re
building something from scratch,
or taking an existing gadget and stripping it
down to add your own touch of magic, it’s 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
deliver our entertainment and information.
We don’t have to think about how they work
and their designers don’t want us to.
Digital making with the Raspberry Pi is the
perfect antidote, and we’ve put together a
selection of easy and intermediate projects
for you to try in our cover feature starting
on page 14. Elsewhere this issue we’re also
building some great devices, including an LED
thermometer, a gadget that turns Python code
into art, and a simple reactions game, among
other things.
Happy making!
PAGE 2
6
D
igital making is fun, but it’s also
SEE PAGE 26 FOR DETAILS
THIS MONTH:
14
GET STARTED WITH DIGITAL MAKING
The perfect cure for a rainy weekend at home!
34
COMMAND LINE HELP & SUPPORT
38
HOW TO POWER YOUR PROJECTS
40
BUILD AN LED THERMOMETER
Learn how to get the command line to help you help yourself
The best (and safest) ways to power your Raspberry Pi project
Russell Barnes
Managing Editor
Read a temperature sensor and display readings on a bar graph
FIND US ONLINE
raspberrypi.org/magpi
EDITORIAL
DESIGN
GET IN TOUCH
magpi@raspberrypi.org
PUBLISHING
Managing Editor:
Russell Barnes
russell@raspberrypi.org
Features Editor:
Rob Zwetsloot
News Editor:
Lucy Hattersley
Sub Editors:
Rachel Churcher and Phil King
Critical Media:
criticalmedia.co.uk
Head of Design:
Dougal Matthews
Designers:
Lee Allen, Daiva Bumelyte,
and Mike Kay
Illustrator:
Sam Alder
For advertising & licensing:
russell@raspberrypi.org +44 (0)7904 766523
Publisher:
Liz Upton
CEO:
Eben Upton
DISTRIBUTION
Seymour Distribution Ltd
2 East Poultry Ave
London
EC1A 9PT |
+44 (0)207 429 4000
This magazine is printed on paper sourced from
sustainable forests and the printer operates an
environmental management system which has
been assessed as conforming to ISO 14001.
SUBSCRIPTIONS
Select Publisher Services Ltd
PO Box 6337
Bournemouth
BH1 9EH |
+44 (0)1202 586 848
CONTRIBUTORS
William Bell, Henry Budden, Mike Cook, Phil King,
Simon Long, Spencer Organ, Les Pounder, Matt
Richardson, Richard Smedley, and Patricio Vivo
The MagPi magazine is published by Raspberry Pi (Trading) Ltd., 30 Station Road, Cambridge, CB1 2JH. The publisher,
editor, and contributors accept no responsibility in respect of any omissions or errors relating to goods, products or services
referred to or advertised in the magazine. Except where otherwise noted, content in this magazine is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0). ISSN: 2051-9982.
raspberrypi.org/magpi
April 2016
2017
3
Contents
Issue 56 April 2017
raspberrypi.org/magpi
TUTORIALS
>
PI 101 – COMMAND LINE HELP
34
How to ask the command line to give you a hand
COVER FEATURE
38
>
PI 101 – POWER YOUR PI
The best ways to power your Raspberry Pi
>
BUILD AN LED THERMOMETER
40
Use GPIO Zero to make a light-up thermometer
>
INTRO TO C PART 10
Learn how to read and write to files from C
42
44
46
50
52
>
TEST YOUR REACTION SPEED
Build a reaction game and find out how fast you are
>
SIMULATE MONOPOLY
Find out the winning moves in Monopoly using a Pi
14
>
LEARN ABOUT SHADERS
>
MAKE DJ TURNTABLE ART
>
DIY MARAUDER’S CLOCK
How to use old-school graphics tech on a Raspberry Pi
Use a DJ Hero turntable to express yourself in pictures
This Potter-inspired project keeps track of your family
56
INCREDIBLE
PROJECTS
RASPBERRY PI
BEATS C64
BLOG IN A BOX
IN THE NEWS
HAPPY BIRTHDAY!
Raspberry Pi 3 - 28%
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%
Ain’t no party like a Raspberry Pi party!
6
The Pi becomes third-best
selling computer ever
8
A blogging platform you
can run on Raspberry Pi
12
4
April 2017
raspberrypi.org/magpi
Contents
THE BIG FEATURE
94
CAMBRIDGE THEME
RASPBERRY PI OS GALLERY
Which Raspberry Pi operating system suits your needs?
Check our definitive guide...
60
Get a taste of home with the
new Cambridge desktop theme
13
06
58
78
96
YOUR PROJECTS
REGULARS
>
NEWS
>
TECHNICAL FAQ
>
BOOK REVIEWS
>
FINAL WORD
COMMUNITY
>
THIS MONTH IN PI
What else happened in the world of Pi?
80
84
86
90
92
28
>
COMMUNITY SPOTLIGHT
Ben Croston makes beers and Python libraries
>
BUILDING A HAT
How to make a HAT using only open-source tools
PI MINI MINT
This Raspberry Pi with a screen is crammed into a mint tin
>
EVENTS
>
LETTERS
We answer your letters on Raspberry Pi and the mag
What Jams and Code Clubs can you go to this month?
 
PI FILM CAPTURE
Using a Camera Module to digitise film
reels, one frame at a time
30
REVIEWS
>
RAINBOW HAT
>
WD COMPUTE CENTRE
>
JUSTBOOM DAC HAT
>
PICAPTURE HD
April 2017
FLY AI
Raspberry Pi plays God with a colony
of flies in a jar
32
72
74
75
76
5
raspberrypi.org/magpi
Zgłoś jeśli naruszono regulamin