6,99 €
A technology book for kids! Do you want to learn how computers work? This book introduces you to the world of computing with the Raspberry Pi - the small, inexpensive, and super-cool microcomputer that teaches real tech skills. Use the Pi to create things while learning all about computers, from the inside out! * Start it up -- get your Raspberry Pi set up, configured, and ready for action * Create music -- start the party using Sonic Pi to record your own songs * Game on -- combine Python and Minecraft and start programming your own video game world.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 120
Veröffentlichungsjahr: 2016
GETTING STARTED WITH RASPBERRY PI®
Published byJohn Wiley & Sons, Inc.111 River StreetHoboken, NJ 07030-5774
www.wiley.com
Copyright © 2016 by John Wiley & Sons, Inc., Hoboken, NJ
Published simultaneously in Canada
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without the prior written permission of the Publisher. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions.
Trademarks: Wiley, the Wiley logo, the For Dummies logo, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and may not be used without written permission. Raspberry Pi is a registered trademark of the Raspberry Pi Foundation. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc. is not associated with any product or vendor mentioned in this book.
LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ.
For general information on our other products and services, please contact our Customer Care Department within the U.S. at 877-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002. For technical support, please visit www.wiley.com/techsupport.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com.
Library of Congress Control Number: 2016933429
ISBN: 978-1-119-26265-7 (pbk); 978-1-119-26266-4 (ebk); 978-1-119-26267-1 (ebk)
Contents
COVER
INTRODUCTION: ABOUT RASPBERRY PI
About This Book
About You
Icons Used in This Book
Where to Go from Here
PROJECT 1: PICK UP PI PARTS
Understanding the Pi System
Picking a Pi Model
Understanding Must-Have Extras
Picking Nice-to-Have Extras
Collecting Parts the Lazy Way: Starter Kits
PROJECT 2: POWER ON YOUR PI
Finding and Recognizing Parts
Setting Up Your Pi System
Setting up Desks and Chairs
Making the Connections
Getting Ready to Turn on the Pi
Lights! Camera! Action!
Setting Up the Pi
Booting into Raspbian
Looking at the Desktop
PROJECT 3: START SCRATCH FROM SCRATCH
Understanding Scratch
Connecting Blocks and Making Scripts
Finding and Starting Scratch
Looking Around Scratch
Understanding the Stage
Moving a Sprite with Go To
Making a Simple Script
Controlling a Script
Making a Simple Bounce Script
Introducing Variables
PROJECT 4: MEET SONIC PI
Getting Started with Sonic Pi
Setting Up Sound on the Pi
Playing Tunes with Sonic Pi
Taking a Guided Tour
Understanding Notes
Making Different Sounds
Making More Complicated Music
PROJECT 5: PICK UP PYTHON
Meet Python
Remember Information
Use the Shell and the Editor
Learning More Python
PROJECT 6: MASTER MINECRAFT WITH PYTHON
Getting Started with Minecraft
Exploring the World
understanding API
S
Using the Minecraft API
PROJECT 7: MORE THINGS TO SEE AND DO
Scratch
Sonic Pi
Python Projects
Minecraft and Python
ABOUT THE AUTHOR
END USER LICENSE AGREEMENT
Cover
Table of Contents
Begin Reading
i
ii
ii
iv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
SO YOU WANT TO BUY A RASPBERRY PI! Do you want to know more about how computers work? Do you want to look inside them to find out what really happens when you click a mouse, press a key on a keyboard, click a link on a website, or launch an app?
This book is for you! It introduces you to the world of the tiny Raspberry Pi computer, which is perfect for learning how computers work.
Unlike big, expensive computers, the Pi is designed to be hands-on. You can get right inside it and make it do tricks that are much harder to do on a PC or a Mac — never mind an Android tablet or an iPad.
The good news is that in some ways, the Pi is very easy to use. But it wouldn’t be fair to pretend that it’s always simple.
In other ways, it can be harder to manage than a Mac or a PC. Because it’s hands-on, you sometimes have to think harder about what you’re doing.
But the Pi is really good for learning how computers work on the inside and for building simple software and hardware projects. It’s also good for learning more about learning, which means finding out how to do your own research on the Internet.
This book is your guide to the fascinating world waiting for you inside your Pi. You can use it to learn:
Why the Raspberry Pi is special
What parts you need to add to a Pi to make it work and how much they cost
Where to find the latest free software for your Pi
How to power up and power down a Pi
How to start using the Linux operating system
What you can do with Scratch, a simple programming system
Why the Sonic Pi music programming system is a ton of fun
How to write code and draw pictures using the popular Python language
How you can use Python to control your character in the Pi version of Minecraft
Getting Started with Raspberry Pi makes some guesses about what you know already.
You don’t need to know anything about code or be a computer genius. But you need some basic computer skills, like the ones on this list:
You can use a Mac or a PC or maybe even a Linux computer.
You’re comfortable with a mouse and keyboard, and you can find your way around your computer’s desktop.
You’re not scared of plugging together computer parts to add extras.
You’re fine with using Google or some other search engine to look up things on the Internet.
You have a little (but not much) cash to spare. Fifty dollars will cover most of what you need, and $100 will cover everything easily.
You know some basic math, and you’re not too scared of adding, subtracting, multiplying, and dividing. (You don’t have to be brilliant at doing them in your head. That’s what computers are for!)
Some of the pages of this book have little round pictures at the sides. Here’s what they mean:
Tips make your life easier. You’ll want to take advantage of them.
When you see this icon, pay special attention, because it points out information you don’t want to forget.
This text warns you of things that can go wrong … so be careful!
You can read this book in any order that makes sense to you. You can flip through it to find new ideas or go through it in order.
I recommend you work through at least the first couple of projects in order. If you’re new to the Raspberry Pi, those early projects have everything you need to get started.
The rest is up to you. Good luck — and don’t forget to have fun and do cool things!
PROJECT 1
BEFORE YOU CAN MAKE A PI, YOU NEED TO BUY SOME PI PARTS. Unlike a Mac or PC, you can pick and choose between many possible options. Or you can be clever: To save time, you can buy a kit with everything you need.
When you buy a PC or a Mac, you get a carful of boxes and extras, and most of the time you get everything you need.
When you buy a Pi, you get a tiny slab of electronics the size of a credit card.
The slab is called a board because it’s flat like a board. So the main part of the Pi is sometimes called the Pi board.
Case? No. Keyboard? Uh uh. Mouse? Not included.
So before you can use your Pi, you have to add a lot of extras. Most homes have the right kind of extras lying around in cupboards, attics, and dens, collecting dust, so you can probably find the right parts you need at home.
But you’ll still have to buy some parts — including the Pi itself.
This project is about collecting parts. Don’t plug them all together yet! It’s especially important you don’t try to power up your Pi until you’ve collected the parts, connected them all together, and followed the instructions in the next project. You can break something if you rush in, so don’t. Yet.
The Pi has been around for a while now, so there’s more than one kind of Pi. You’ll see Model As and Model Bs and Pi Zeroes, and all kinds of other things.
Keep it simple. You want a Raspberry Pi Model 2. It’s the latest, fastest, and best Pi ever. It’s very cheap, and it does everything you want.
Technically, the full name is the Model 2 B+. But you can ignore the B+ on the end, because usually it’s just called a Pi 2.
Don’t buy anything that isn’t a Pi 2. Older Pi models aren’t as good as the 2. And you can ignore the Pi Zero. It’s really, really cheap, but it doesn’t do half the things that a Pi 2 does, and this book won’t mention it again, even though it’s quite cool, in a tiny way.
Must-have extras aren’t optional. Your Pi system has to include them, or you can’t use it.
Here’s a list:
USB keyboard
USB mouse
Monitor
Monitor cable
Memory card
Power supply
Long network cable
Space to set up
Many homes have an old mouse and keyboard gathering dust. The make and model don’t matter, as long as both items have a USB cable — that’s the cable that looks like a long thin rectangular slot and plugs into another long thin slot, usually the wrong way around because no one ever plugs it in right the first time.
Bluetooth wireless keyboards won’t work, so you can’t use an Android/iPad keyboard or one of those thin and clicky Apple keyboards that doesn’t have a cable coming out the back.
You can use a wireless mouse and/or keyboard as long as they have a USB dongle — a tiny USB plug that picks up the mouse and/or keyboard by radio magic. Logitech is a good name to look for, but most wireless brands should work.
Almost any modern-ish LCD monitor will do. The Pi doesn’t have brilliant graphics, so the monitor doesn’t have to be expensive.
If you don’t care about elbowing the rest of the family out of the way while they’re watching their favorite shows, you can probably use the family TV. A monitor of your own is better and will keep everyone else sweet.
The Pi has a special socket for a monitor cable. It’s called an HDMI socket, and it’s long, thin, and flat — even longer and thinner than a USB socket.