爱上树莓派爱上Raspberry Pi_完整版

所需积分/C币:40 2014-04-18 11:23:58 14MB PDF
收藏 收藏 18
举报

爱上树莓派 爱上Raspberry Pi 完整版
Getting Started with Raspberry Pi Matt Richardson and shawn Wallace OREILLY Beijing·〔 ambridge· Farnham·Koln· Sebastopol· Tokyo Getting Started with Raspberry Pi by Matt Richardson and shawn wallace Copyright C 2013 Matt Richardson and Shawn Wallace. All rights reserved Printed in the united states of america Published by o reilly media, Inc, 1005 Gravenstein highway north sebastopol, ca 95472 O Reilly books may be purchased for educational, business, or sales promotional use Online editionsarealsoavailableformosttitles(http://my.safaribooksonline.com).Formoreinfor mation, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com Editor: Brian Jepson Production Editor: Christopher Hearse Cover Designer: Randy comer Interior Designer: Ron Bilodeau and Edie Freedman Illustrator: marc de vinck December 2012: First edition Revision History for the first edition: 2012-12-07 First release Seehttp://oreilly.com/catalog/errata.csp?isbn=9781449344214forreleasedeta Nutshell Handbook, the Nutshell Handbook logo, and the O Reilly logo are registered trade- marks of O'Reilly Media, Inc. Getting Started with Raspberry Pi and related trade dress are trademarks of O Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and o Reilly m dia, Inc, was aware of a trademark claim, the designations have been printed in caps or initial caps While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein lSBN:978-1-449-34421-4 Contents Preface..,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 1/Getting Up and Running...................... 1 A Tour of the boards The Proper peripherals The Case Flash the sd card 10 Booting u 11 Configuring Your Pi. ..12 Shutting Down Troubleshooting. 15 Going Further. ,,,,.,.,..16 2/Getting Around Linux on the Raspberry Pi. 17 Using the command Line Files and the Filesystem. 20 More linux commands 24 Processes Sudo and permissions 26 The Network 28 29 Setting the Date and Time. 30 Installing New Software................. ,30 Going Further. 3/Python On The Pi 33 Hello python 34 A Bit More Python.……… 36 Objects and Modules Even more module 41 Troubleshooting Errors....………,…….… Going Further. ,,,,,,,,,42 4/Animation and Multimedia in Python Hello pygame game Surfaces. Drawing on Surfaces........ Handling events and Inputs 49 Sprites. Playing Sound. Playing Video.... Further Reading.∴ 5/Scratch on the pi Hello scratch ,,。,,,,,,,,,,,,,,,,,,,,,,,,...57 The stage ,。,,,。,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,..61 Two More Things to Know About Sprites. A Bigger Example: Astral Trespassers. Scratch and the Real World Sharing Your Programs. 71 Going Further. 6/Arduino and the pi stalling Arduino in Raspbian ............... 76 Finding the serial Port Talking in Serial........ 78 Going Further. .82 7/Basic Input and Output. Using Inputs and Outputs..……… Digital Output: Lighting Up an LED. Digital Input: Reading a Button. ,90 Project: Cron Lamp Timer. Scripting Commands. ,94 Connecting a Lamp. Scheduling commands with cron........... Going Further. 8/Programming Inputs and outputs with Python stalling and Testing GPIO in Python. Blinking an LED 102 Reading a Button.∴ 104 iv Contents Project: Simple Soundboard.................... 106 Going Further. ,,,。,,.109 9/Working with Webcams 111 Testing Webcams ,,,,112 stalling and Testing SimpleCV. ..,113 Displaying an image 114 Modifying an Image 116 Accessing the Webcam ,,,,,,,,,,,,118 Face Detection 120 Project: Raspberry Pi Photobooth............... 121 Going Further.............. 124 10/Python and The Internet. .....125 Download data from a Web server ,,125 Fetching the Weather Forecast............. 127 Serving Pi(Be a Web Server). 131 Flask basics 132 Connecting the Web to the Real World. 135 Project: WebLamp ..137 Going Further. 141 A/ Writing an SD Card Image. 143 B/ Astral Trespassers Complete ,。147 C/ Analog Input. 153 Preface It's easy to understand why people were skep- tical of the Raspberry Pi when it was first an nounced. A credit card-sized computer for $35 seemed like a pipe dream. Which is why, when it started shipping, the raspberry Pi created a frenzy of excitement Demand outstripped supply for months and the waitlists for these mini com puters were very long. Besides the price, what is it about the raspberry pi that tests the patience of this hardware-hungry mass of people? Before we get into everything that makes the Raspberry Pi so great, let's talk about its intended audience Eben Upton and his colleagues at the University of cambridge noticed that today's students applying to study computer science don't have the skills that they did in the 1990s. They attribute this to-among other factors-the rise of the home Pc and games console to replace the amigas, BBC Micros, Spectrum ZX and Commodore 64 machines that people of an earlier gen eration learned to program on "Since the computer has become important for every member of the household, it may also discourage younger mer bers from tinkering around and possibly putting such a critical tool out of commission for the family. But recently mobile phone and tablet processors have become less expensive while getting more powerful, clearing the path for the Raspberry Pi's leap into the world of ultra-cheap-yet-serviceable computer boards. As the founder of Linux, Linus Torvalds, said in an interview with BBC News, Raspberry Pi makes it possible to "afford failure What Can You Do with it? One of the great things about the Raspberry Pi is that there's no single way to use it. Whether you just want to watch videos and surf the web, or you want to hack, learn, and make with the board, the raspberry Pi is a flexible platform for fun, utility, and experimentation Here are just a few of the different ways you can use a Raspberry Pi General purpose computing It's important to remember that the raspberry Pi is a computer and you can, in fact, use it as one. After you get it up and running in Chapter 1, you can choose to have it boot into a graphical desktop environment with a web browser, which is a lot of what we use computers for these days going beyond the web, you can install a wide variety of free software such as the Libreoffice productivity suite for working with documents and spreadsheets when you dont have an Internet connection Learning to program Since the Raspberry pi is meant as an educational tool to encourage kids to experiment with computers, it comes preloaded with interpreters and compilers for many different programming languages. For the beginner, there's Scratch, a graphical programming language from MiT, which we cover in Chapter 5. If you' re eager to jump into writing code, the Python programming language is a great way to get started and we cover the basics of it in Chapter 3. And you re not limited to only Scratch and Python. You can write programs for your Raspberry Pi in many different programming languages like C, Ruby, Java, and Pel Project platform The Raspberry pi differentiates itself from a regular computer not only in its price and size, but also because of its ability to integrate with elec tronics projects. Starting in Chapter 7, we'll show you to how to use the Raspberry Pito control LEDs and ac devices and you'll learn how to read the state of buttons and switches Raspberry Pi for Makers As makers, we have a lot of choices when it comes to platforms on which to build technology-based projects. Lately, microcontroller development boards like the Arduino have been a popular choice because they've become very easy to work with. But System on a Chip platforms like the Raspberry pi are a lot different than traditional microcontrollers in many ways. In fact, the Raspberry Pi has more in common with your computer than it does with an Arduino This is not to say that a raspberry pi is better than a traditional microcon troller; it's just different. For instance, if you want to make a basic thermostat, you're probably better off using an Arduino Uno or similar microcontroller for purposes of simplicity. But if you want to be able to remotely access the thermostat via the web to change its settings and download temperature log files, you should consider using the Raspberry Pi Choosing between one or the other will depend on your projects require ments and in fact, you don't necessarily have to choose between the two. In Chapter 6, well show you how to use the Raspberry Pito program the arduino and get them communicating with each other Preface

...展开详情
试读 127P 爱上树莓派爱上Raspberry Pi_完整版
立即下载 低至0.43元/次 身份认证VIP会员低至7折
    一个资源只可评论一次,评论内容不能少于5个字
    思入风云道通天地 其实这个资源购买了树莓派就有,但是这么贵的,很少见
    2019-01-02
    回复
    micro_hz A excellent book to learn raspberry pi..
    2018-05-14
    回复
    ran_jm 很好,适合初学者
    2018-05-02
    回复
    nj_zbl 非常好的资料,很适合初学者
    2018-01-30
    回复
    庄华 谢谢分享,英文版的,看着比较吃力。
    2018-01-19
    回复
    hebmagic 完整英文版
    2018-01-04
    回复
    lifeisshortyouneed 英文版本 高清 文字的 很不错~!
    2017-08-17
    回复
    daw1213 英文的,可粘贴的数字版pdf
    2017-01-05
    回复
    yuanmengool 完整英文版
    2016-11-01
    回复
    Evan652233214 不错的东东,学习一下
    2016-06-18
    回复
    • 分享精英

      成功上传11个资源即可获取
    关注 私信 TA的资源
    上传资源赚积分,得勋章
    最新推荐
    爱上树莓派爱上Raspberry Pi_完整版 40积分/C币 立即下载
    1/127
    爱上树莓派爱上Raspberry Pi_完整版第1页
    爱上树莓派爱上Raspberry Pi_完整版第2页
    爱上树莓派爱上Raspberry Pi_完整版第3页
    爱上树莓派爱上Raspberry Pi_完整版第4页
    爱上树莓派爱上Raspberry Pi_完整版第5页
    爱上树莓派爱上Raspberry Pi_完整版第6页
    爱上树莓派爱上Raspberry Pi_完整版第7页
    爱上树莓派爱上Raspberry Pi_完整版第8页
    爱上树莓派爱上Raspberry Pi_完整版第9页
    爱上树莓派爱上Raspberry Pi_完整版第10页
    爱上树莓派爱上Raspberry Pi_完整版第11页
    爱上树莓派爱上Raspberry Pi_完整版第12页
    爱上树莓派爱上Raspberry Pi_完整版第13页
    爱上树莓派爱上Raspberry Pi_完整版第14页
    爱上树莓派爱上Raspberry Pi_完整版第15页
    爱上树莓派爱上Raspberry Pi_完整版第16页
    爱上树莓派爱上Raspberry Pi_完整版第17页
    爱上树莓派爱上Raspberry Pi_完整版第18页
    爱上树莓派爱上Raspberry Pi_完整版第19页
    爱上树莓派爱上Raspberry Pi_完整版第20页

    试读已结束,剩余107页未读...

    40积分/C币 立即下载 >