Beginners_Book_v1.pdf

(23036 KB) Pobierz
FROM THE MAKERS OF
THE OFFICIAL RASPBERRY PI MAGAZINE
Tutorial
WALKTHROUGH
ESSENTIALS
LEARN | CODE | MAKE
ONLY
£3.99
raspberrypi.org/magpi
from
OUT NOW IN PRINT
ESSENTIALS
From the makers of the
official Raspberry Pi magazine
GET THEM
DIGITALLY:
Welcome
WELCOME TO
THE OFFICIAL
RASPBERRY PI
BEGINNER’S BOOK
Y
ou are holding, in your hands, a piece of history.
The Official Raspberry Pi Beginner’s Book isn’t just
a book about a computer: It’s a book
with a computer.
Not just any computer either. The Pi Zero W is an
incredibly well-designed microcomputer. And it’s the most
creative programmable computer on earth.
With a Raspberry Pi, you can hack, make and build all
kinds of different things. It could be a digital camera, or a
retro games console, or a home media centre. Or a sensor on
board the International Space Station, or a programmable
Minecraft machine.
Everything you need to get started with a Raspberry Pi
computer is inside this kit.
Our tutorials will guide you, step-by-step, from setting up
the Pi Zero W hardware to learning how to use the Raspbian
operating system, through to hacking electronics with the
GPIO pins on your Pi Zero W.
You’ll also learn how to program a computer with Python,
the world’s best programming language. We show coding
the fun way, by hacking worlds in Minecraft and making your
own games.
We’re so glad you’ve got The Official Raspberry Pi
Beginner’s Book. Now let’s get started…
Lucy Hattersley
Editor
FIND US ONLINE
raspberrypi.org/magpi
EDITORIAL
DESIGN
GET IN TOUCH
magpi@raspberrypi.org
PUBLISHING
Publishing Director:
Russell Barnes
Editor:
Lucy Hattersley
Features Editor:
Rob Zwetsloot
Sub Editors:
Phil King, Jem Roberts
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
Comms Director:
Liz Upton
CEO:
Eben Upton
DISTRIBUTION
Seymour Distribution Ltd
2 East Poultry Ave
London
EC1A 9PT |
+44 (0)207 429 4000
MAGAZINE SUBSCRIPTIONS
Select Publisher Services Ltd
PO Box 6337
Bournemouth
BH1 9EH |
+44 (0)1202 586 848
CONTRIBUTORS
Phil King, Laura Sach,
Marc Scott, K.G. Orphanides,
and Clive Webster
This bookazine 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.
This official product is published by Raspberry Pi (Trading) Ltd., 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). ISBN: 978-1-912047-70-3.
raspberrypi.org/magpi
The Official Raspberry Pi Beginner’s Book
March 2015
3
Contents
06
GETTING STARTED
Plug in and set up your Raspberry Pi
Install the Raspbian OS with NOOBS
Use Etcher to install an image file
Adjust the settings in Raspbian
52
BUILD A WEB SERVER
Share webpages on a local network
Keep your files safe with a backup
Discover the power options
22
BEGINNER’S GUIDE TO NOOBS
54
BACK UP YOUR RASPBERRY PI
56
POWER YOUR RASPBERRY PI
24
CREATE SD CARDS WITH ETCHER
26
THE CONFIGURATION TOOL
28
MAKE A MEDIA CENTRE
58
GET HELP FROM THE COMMAND LINE
Find help for command-line tools
Create a home theatre system
Remote-control the Pi from another computer
Attach a camera to your Raspberry Pi
Work faster and smarter
62
MINECRAFT PI
30
BEGINNER’S GUIDE TO VNC
32
THE PI CAMERA
Start using Minecraft on your Raspberry Pi
Hack and code Minecraft with your Pi
Expert tips and coding tricks for Minecraft Pi
The rough guide to Python on a Pi
64
MINECRAFT PI CODING TIPS
34
SWITCH TO THE COMMAND LINE
40
BEGINNER’S GUIDE TO SSH
42
GPIO ZERO
Access the command line remotely
Control the pins on your Raspberry Pi
Prototype circuits
68
MINECRAFT PI TIPS & TRICKS
72
BEGINNER’S GUIDE TO CODING
86
UNDERSTAND OBJECT-ORIENTED CODING
Discover this popular style of programming
The tool used by developers everywhere
Simulate the Pi hardware used in space
Behind the scenes with the team who built it
46
HOW TO USE A BREADBOARD
48
CODE IN PYTHON WITH THONNY
50
SET UP A FILE SERVER
Discover Thonny, a Python coding tool
96
CODE WITH GIT
102
SENSE HAT EMULATOR
104
INSIDE THE PI ZERO W
Save and share files on a home network
GETTING STARTED WITH YOUR PI ZERO W
06
SET UP A PI CAMERA MODULE
32
CREATE SD CARDS WITH ETCHER
24
4
The Official Raspberry Pi Beginner’s Book
raspberrypi.org/magpi
The Official Raspberry Pi Beginner’s Book
A B C D E
F G H
I
J
1
1
5
5
Contents
46
BUILD WORLDS WITH MINECRAFT PI
62
HOW TO USE A BREADBOARD
10
10
15
15
20
20
25
25
30
A B C D E
F G H
I
J
30
THE CONFIGURATION TOOL
26
UNDERSTAND OBJECT-ORIENTED PROGRAMMING
86
INSIDE THE PI ZERO W
104
SENSE HAT EMULATOR
102
raspberrypi.org/magpi
The Official Raspberry Pi Beginner’s Book
5
Zgłoś jeśli naruszono regulamin