YOUR OFFICIAL RASPBERRY PI MAGAZINE Issue 39 • Nov 2015 Win! 10 RasPi Model A+s Thanks to MODMYPI.COM
100 pages of hacking & making Issue 39 November 2015 raspberrypi.org/magpi
TIME-LAPSE INTRODUCING GPIO ZERO PHOTOGRAPHY Controlling your Make the most of the electronics has Pi Camera Module never been easier
ASTRO PI 3D PRINTED UPDATE GAME BOY T-minus one Play your retro month and games in style counting! 30:00 MINUTE PROJECTS PIXEL ART BUILD A WITH THE Amazing ideas made in moments PINGOMETER SENSE HAT How to visualise your Amazing old-school internet connection graphics made easy
Also inside: > MAKE GAMES WITH RASPBERRY PI > MASTER PIMORONI’S SKYWRITER HAT Everything you > CREATE AMAZING MUSIC WITH SONIC PI need to know to > REVIEWED: SCRATCH, RASPBIAN & MORE get started today
THE ONLY MAGAZINE WRITTEN BY THE COMMUNITY, FOR THE COMMUNITY
Welcom
PROUD WELCOME TO SUPPORTERS OF: THE OFFICIAL PI MAGAZINE! ime is often our enemy. There never seems to be enough of it. I’m often frustrated T that, after a long day at work, I rarely get more than an hour to pursue my hobbies before it’s time to climb the wooden stairs to Bedfordshire. Since I’m in charge around here, it’s only fair that you indulge me this month’s cover feature about Raspberry Pi projects I can complete in 0 minutes from start to finish. It doesn’t matter if you’re a beginner, a seasoned pro, or you’re simply looking for a project that holds the attention of the most demanding o spring we’ve got something for you. Get started today with our feature on page 16 – please let us know if you’ve got a 30-minute project of your own, too. By the way, do you have an Android or Apple smartphone or tablet? If you do, you might be interested to know that you can now download all THIS MONTH: 30 original issues of The MagPi in our app, as well as get the chance to subscribe to automagically 16 MAKE QUICK-FIRE PI PROJECTS receive every new issue for as little as £20 for a Got half an hour spare this weekend? Here’s an idea… year. Just search for us in your store of choice or find out more on page 0. nce you’ve downloaded 6 RASPBIAN GETS RELOADED Learn more on page 6 and read our verdict on page 78 the app, you’ll also find the first in a new range of The MagPi’s Essential e-book range: learn to love the GPIO HACKING IS NOW CHILD’S PLAY command line with the help of our resident Bash 12 We speak to Ben Nuttall about GPIO Zero, a new way to hack e pert, Richard medley. ou can find out more about his e-book on page . 42 MASTER THE PI TOUCHSCREEN Russell Barnes Our eight-page special feature shows you how
FIND US ONLINE raspberrypi.org/magpi GET IN TOUCH [email protected]
EDITORIAL DESIGN PUBLISHING Managing Editor: Russell Barnes Critical Media: criticalmedia.co.uk For advertising & licensing: [email protected] +44 (0)7904 766523 Head of Design: Dougal Matthews [email protected] +44 (0)7904 766523 Features Editor: Rob Zwetsloot Designers: Lee Allen, Mike Kay Publisher: Liz Upton Technical Editor: David Whale Illustrator: Sam Alder CEO: Eben Upton Sub Editors: Laura Clay, Phil King, Lorna Lynch DISTRIBUTION SUBSCRIPTIONS CONTRIBUTORS Seymour Distribution Ltd Select Publisher Services Ltd Sam Aaron, Mike Cook, Gareth Halfacree, 2 East Poultry Ave PO Box 6337 Lucy Hattersley, Richard Hayler, Jasper Hayler- London Bournemouth Goodall, Phil King, Simon Monk, Matt Richardson, EC1A 9PT | +44 (0)207 429 4000 BH1 9EH | +44 (0)1202 586 848 James Singleton, Richard Smedley & Sean Tracey.
This magazine is printed on paper sourced from The MagPi magazine is published by Raspberry Pi (Trading) Ltd., Mount Pleasant House, Cambridge, CB3 0RN. The sustainable forests and the printer operates an publisher, editor and contributors accept no responsibility in respect of any omissions or errors relating to goods, products environmental management system which has or services referred to or advertised in the magazine. Except where otherwise noted, content in this magazine is licensed been assessed as conforming to ISO 14001. under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0). ISSN: 2051-9982. raspberrypi.org/magpi NovemberMarch 2015 3
Contentraspberrypi.org/magpi Issue 39 November 2015 Featur 30-MINUTE PROJECTS LUCY HATTERSLEY A technology writer and accomplished magazine editor, Lucy is well versed in all sorts of areas in the tech sector. about.me/lucyhattersley TUTORIALS COVER FEATURE @lucyhattersley > BUILD A PINGOMETER 50 Join Dr Simon Monk for more Everyday Engineering fun CONNECT YOUR PI TO YOUR SMARTPHONE AND WATCH > MAKE MAGIC PRESENTATIONS 54 Add Pushbullet to your Pi and get pings right on your wrist Use Pimoroni’s Skywriter to baffle & amaze your audience!
INFO CARD project overview > TIME-LAPSE PHOTOGRAPHY 56 ou can set up Pushbullet on your Make incredible videos using cleverly captured pictures i culty phone and smartwatch, and use it Medium to get your alerts from your Pi. The full Pushbullet PI re uires Type coding in Ruby, but we found it a Programming lot easier to build a script in Uni > MIKE’S PI BAKERY: AMAZE 58 that sends the alert, and then Requirements use the module in your Python How the Pi can help you navigate a tricky maze iPhone or Android phone programs to run the script. (optional Apple Watch The Pushbullet PI works by or Google Watch), using the curl command, along Pushbullet account with your ccess Token, to call the > Pushbullet service. our ccess PIXEL ART WITH THE SENSE HAT 64 Token is a uni ue number that How to put stunning 8×8 retro imagery up in lights One neat trick we links the Pushbullet service with recently discovered Pushbullet apps installed on your is how to hook up a devices. ou can learn more about Raspberry Pi to an Apple the PI at docs.pushbullet.com, but Watch. You do this using a we’ll walk you through it and16 show > SONIC PI: CREATE AMAZING BASS 66 service called Pushbullet, which you how easy it is. normally syncs notifications from Dr Sam Aaron continues his series. This month: the TB-303 your desktop computer, but handily Installing Pushbullet comes with an API for the Raspberry Pi. tart by installing the free It’s simple to set up and comes in useful for Pushbullet app on your ndroid all kinds of projects. phone or iPhone. hen you first > launch Pushbullet, you’ll need to GAMES WITH PYTHON: PART 9 68 30-MINUTE PROJECTSHook up a Pushbullet is an app for the iPhone in their programs. This is great Raspberry Pi to sign up with a oogle or acebook and ndroid that enables you to because it turns out you can easily your Apple Watch account enter your email and In his penultimate piece, Sean starts making a space shooter At a loose end? Grab your toolkit and give one ofto theseget alerts from quick-fire projects a try send notifications from your P create a script that sends you an your programs password for that and tap ign In. directly on or ac to your mobile device. It’s alert with a custom message. nd your wrist That’s it for your phone and pple mainly designed so people can sync your Pi can easily call the script. atch everything else needs to be alerts from their main computer to hy we really love this is because done on the Raspberry Pi. an iPhone or ndroid phone, and Pushbullet has support for the new get notifications on their phone smartwatches, such as the pple The Access Token from their computer. atch and oogle atch. ith a bit ooking your Pi up to the app you’ve IN THE NEWS A BRIEF owever, there is an HISTORY PI for of tinkering, you can get alerts sent ust installed re uires an ccess Pushbullet that developers can use from your Raspberry Pi directly to Token. This is a long alphanumerical OFto include ASTRO support for the service PI your wrist. ow cool is that key that is uni ue to your account. 20 November 2015 raspberrypi.org/magpi12
6 016-027_MPi#39_30MinsProjects_v2-PK-LC-RB-LA.indd 20 22/10/2015 09:56
INTRODUCING GPIO ZERO RASPBIAN UPGRADES 10 Ben Nuttall tells us all about his TO DEBIAN 8 JESSIE Find out what’s been happening with new easy-to-use package for Raspberry Pi’s own Simon Long gives us the the incredible space mission that’ll see talking to the GPIO pins on your lowdown on the latest tweaks and changes two Pis taken to the ISS this December Raspberry Pi
4 November 2015 raspberrypi.org/magpi Content
THE BIG FEATURE
91
A STRONGER FOUNDATION
Get started with the official touchscreen for Raspberry Pi with our eight-page special feature 42 We speak to the new CEO of The Raspberry Pi 14 Foundation about plans for 2016 and beyond
YOUR PROJECTS REGULARS > NEWS 6 Keep up to date with the biggest stories from the world of Pi > TECHNICAL FAQS 76 Got a problem? Our experts answer all your questions > BOOK REVIEWS 86 The latest computer books reviewed and rated > THE FINAL WORD 96 30 Matt Richardson welcomes the Pi going mainstream
MINI MAC PI COMMUNITY Adafruit’s Ruiz brothers do it again, this time bringing back the 128kB glory days > EVENTS 88 Mason Jar 32 Find a community gathering near you in the coming weeks Matt Reed shows us how to preserve digital > SKYCADEMY UPDATE 92 memories in style, with this amazing project Schoolkids launch a Pi balloon up into the stratosphere > LETTERS 94 RaftBerry 34 Have your say on the magazine and the community A Raspberry Pi-powered raft, perfect for a picnic on the lake next summer… REVIEWS Super GameGirl 36 > RASPBIAN 78 The latest image brings some new features to the fore It’s smaller than the original Game Boy and plays just about any classic game you can mention > SCRATCH 80 Scratch is evolving – find out what we think of the new build CNC Machine 38 How do you combine a passion for beautiful > MEDIA PI PLUS 82 woodworking with an interest in electronics? We check out a new multimedia case and remote for the Raspberry Pi
raspberrypi.org/magpi November 2015 5 New FEATURE RASPBIAN UPGRADES TO JESSIE Move from penguin to cowgirl as Raspbian sees some upgrades under the hood and a few more to the interface
or over three years now, 7.0 ‘Wheezy’ as its base; at the Raspberry Pis around the time, it was the testing branch of F world have been running Debian, getting rolling updates as Raspbian, the official operating they came and allowing for uick system for the Pi. tarting o updates and upgrades to fi bugs merely as a version of Debian and such. ince then, not only has Linux that was optimised for the Debian 7.0 gone stable, the two- Pi, it’s since grown to include year development cycle for this more and more Pi software, Linux distribution has been and along with an interface overhaul gone, and hee y was replaced by Above The new config menu is much nicer and easier to use last year and other smaller the stable version of Debian 8.0, improvements unique to the or Jessie, earlier this year. JESSIE SUDOES WHAT Raspberry Pi. What made Raspbian This brings us to now essie WHEEZY SUDON’T so special was the way it worked is the newer, shinier version of more naturally on the R chip Debian, with updates to a lot of One of the changes that will have a small yet that powers the Raspberry Pi software along with a few new significant e ect on i users is the ability to access known as hard oat), rather than pieces. The Pi community has the pins without having to use sudo on some other operating systems been asking for essie for a while, ython or other scripts. pening a normal that tried to get it working with and at the very end of September from the menus and trying to run a script that software or soft oat). asically, the Raspberry Pi Foundation accesses them will automatically do so this now it’s easier to work with the delivered a new Raspbian works from cratch as well, so even novices can hardware naturally than to try based on Debian 8.0. do some physical pro ects. t s also well timed, and emulate working with it Hopefully, by the time you’re now that ero is out check out our news everything runs a lot smoother on reading this, you’ve got it installed feature on that page 3 for more information hard oat. and set up on your Raspberry Pi. on why it makes easier to use. For the last three years, s you may have noticed, there’s a Raspbian has been using Debian bit more to Jessie than just a name
6 November 2015 raspberrypi.org/magpi RASPBIAN JESSIE New
change and a number increment. as a computer in its own right a ery minor, but e spoke to imon ong, the computer that could be used as a nonetheless a great engineer responsible for user low-budget replacement to those addition, the panel now has an e ect menu interface design at Raspberry Pi, who need it, whether it’s low- to make sure storage to talk about all the changes he’s income communities or poorer is properly unmounted from aspbian before been working on. countries. is ob is to work you remove it from its physical slot There’s a bit more to Jessie The ibre ce suite is now installed by default, and than just a name change works ust fine on even the older aspberry i models. This version has been around and a number increment for a bit, but has seen some upgrades for the essie release
“I wanted Raspbian to be on how the user e perience on something I’d want to use,” Raspbian is the best it can be, so The raspi config settings menu now Simon tells us, explaining his that the education side’s ob can has its own dedicated graphical tool reasoning behind the direction be done much better. that performs the same task. t s much neater, cleaner, and easier to of Raspbian over the past year. This leads onto the first use than before I spent a year hacking about somewhat controversial change to at the desktop, which before I Raspbian the switch to desktop started had very little attention by default. oot to the command The program menu has some minor paid to it.” line makes your computer look aesthetic tweaks but works the same imon and ben Upton, co- like a machine from , way. The ther category is only hidden now, rather than fully removed, and will creator of the Raspberry Pi, Simon explains, telling us appear if a program installs to it wanted the Pi to also function further that this was a change raspberrypi.org/magpi November 2015 7 New FEATURE
OFFICE PI ibre ce is in aspbian essie by default but why now