Transcription of Raspberry Pi User Guide - Computer Science
1 Raspberry Pi User GuideTable of ContentsIntroductionProgramming is fun!A bit of historySo what can you do with the Raspberry Pi?Part I: Connecting the BoardChapter 1: Meet the Raspberry PiARM vs. x86 Windows vs. LinuxGetting Started with the Raspberry PiConnecting a DisplayConnecting AudioConnecting a Keyboard and MouseFlashing the SD CardConnecting External StorageConnecting the NetworkConnecting PowerChapter 2: Linux System AdministrationLinux: An OverviewLinux BasicsIntroducing DebianUsing External Storage DevicesCreating a New User AccountFile System LayoutLogical LayoutPhysical LayoutInstalling and Uninstalling SoftwareFinding SoftwareInstalling SoftwareUninstalling SoftwareUpgrading SoftwareChapter 3.
2 TroubleshootingKeyboard and Mouse DiagnosticsPower DiagnosticsDisplay DiagnosticsBoot DiagnosticsNetwork DiagnosticsThe Emergency KernelChapter 4: Network ConfigurationWired NetworkingWireless NetworkingChapter 5: Partition ManagementCreating a New PartitionResizing Existing PartitionsAutomatic ResizingManual ResizingMoving to a Bigger SD CardImaging from LinuxImaging from OS XImaging from WindowsChapter 6: Configuring the Raspberry PiHardware Settings the DisplayBoot OptionsOverclocking the Raspberry PiDisabling L2 CacheEnabling Test ModeMemory Partitioning Settings II: Using the Pi as a Media Centre, Productivity Machine and Web ServerChapter 7: The Pi as a Home Theatre PCPlaying Music at the ConsoleDedicated HTPC with RasbmcStreaming Internet MediaStreaming Local Network MediaConfiguring RasbmcChapter 8: The Pi as a Productivity MachineUsing Cloud-Based AppsUsing Editing with The GimpChapter 9.
3 The Pi as a Web ServerInstalling a LAMP StackInstalling WordPressPart III: Programming and HackingChapter 10: An Introduction to ScratchIntroducing ScratchExample 1: Hello WorldExample 2: Animation and SoundExample 3: A Simple GameRobotics and SensorsSensing with the PicoBoardRobotics with LEGOF urther ReadingChapter 11: An Introduction to PythonIntroducing PythonExample 1: Hello WorldExample 2: Comments, Inputs, Variables and LoopsExample 3: Gaming with pygameExample 4: Python and NetworkingFurther ReadingChapter 12: Hardware HackingElectronic EquipmentReading Resistor Colour CodesSourcing ComponentsOnline SourcesOffline SourcesHobby SpecialistsThe GPIO PortUART Serial BusI C BusSPI BusUsing the GPIO Port in PythonInstalling the GPIO Python LibraryGPIO Output: Flashing an LEDGPIO Input: Reading a ButtonMoving Up From the BreadboardA Brief Guide to SolderingChapter 13: Add-on BoardsCiseco Slice of PiAdafruit Prototyping Pi PlateFen Logic GertboardPart IV: AppendixesAppendix A: Python RecipesAppendix B.
4 HDMI Display ModesRaspberry Pi User GuideEben Upton and Gareth HalfacreeRaspberry Pi User GuideThis edition first published 2012 2012 Eben Upton and Gareth HalfacreeRegistered officeJohn Wiley & Sons Ltd., The Atrium, Southern Gate, Chichester, West Sussex, PO19 8SQ, UnitedKingdomFor details of our global editorial offices, for customer services and for information about how to applyfor permission to reuse the copyright material in this book please see our website at right of the authors to be identified as the authors of this work has been asserted in accordancewith the Copyright, Designs and Patents Act rights reserved.
5 No part of this publication may be reproduced, stored in a retrieval system, ortransmitted, in any form or by any means, electronic, mechanical, photocopying, recording orotherwise, except as permitted by the UK Copyright, Designs and Patents Act 1988, without the priorpermission of the also publishes its books in a variety of electronic formats. Some content that appears in print maynot be available in electronic used by companies to distinguish their products are often claimed as trademarks. Allbrand names and product names used in this book are trade names, service marks, trademarks orregistered trademarks of their respective owners.
6 The publisher is not associated with any product orvendor mentioned in this book. This publication is designed to provide accurate and authoritativeinformation in regard to the subject matter covered. It is sold on the understanding that the publisher isnot engaged in rendering professional services. If professional advice or other expert assistance isrequired, the services of a competent professional should be : Wiley and the Wiley logo are trademarks or registered trademarks of John Wiley andSons, Ltd. and/or its affiliates in the United States and/or other countries, and may not be used withoutwritten permission.
7 Raspberry Pi and the Raspberry Pi logo are registered trademarks of the RaspberryPi Foundation. All other trademarks are the property of their respective owners. John Wiley & Sons,Ltd. is not associated with any product or vendor mentioned in the Drive is a registered trademark of Google .A catalogue record for this book is available from the British 978-1-118-46446-5 (pbk); ISBN 978-1-118-46448-9 (ebk); ISBN 978-1-118-46447-2 (ebk); ISBN978-1-118-46449-6 (ebk)Set in 10 pt. Chaparral Pro by Indianapolis Composition ServicesPrinted simultaneously in Great Britain and the United StatesPublisher s AcknowledgementsSome of the people who helped bring this book to market include the following.
8 Editorial and ProductionVP Consumer and Technology Publishing DirectorMichelle LeeteAssociate Director Book Content ManagementMartin TribeAssociate PublisherChris WebbExecutive Commissioning EditorCraig SmithAssistant EditorEllie ScottProject EditorKathryn DugganCopy EditorKathryn DugganTechnical EditorOmer KilicEditorial ManagerJodi JensenSenior Project EditorSara ShlaerEditorial AssistantLeslie SaxmanMarketingAssociate Marketing DirectorLouise BreinholtMarketing ManagerLorna MeinSenior Marketing ExecutiveKate ParrettComposition ServicesCompositorErin ZeltnerProofreaderWordsmith EditorialIndexerBIM Indexing & Proofreading ServicesAbout the AuthorsEben Upton is a founder and trustee of the Raspberry Pi Foundation, and serves as its Executive Director.
9 He is responsible forthe overall software and hardware architecture of the Raspberry Pi, and for the Foundation's relationships with its key suppliersand customers. In an earlier life, he founded two successful mobile games and middleware companies, Ideaworks 3d Ltd. andPodfun Ltd., and held the post of Director of Studies for Computer Science at St John's College, Cambridge. He holds a BA, aPhD and an MBA from the University of his day job, Eben works for Broadcom as an ASIC architect and general Halfacree is a freelance technology journalist and the co-author of the Raspberry Pi User Guide alongside project co-founder Eben Upton.
10 Formerly a system administrator working in the education sector, Gareth s passion for open sourceprojects has followed him from one career to another, and he can often be seen reviewing, documenting or even contributing toprojects including GNU/Linux, LibreOffice, Fritzing and Arduino. He is also the creator of the Sleepduino and Burnduino openhardware projects, which extend the capabilities of the Arduino electronics prototyping system. A summary of his current workcan be found at Liz, who made it all possible. EbenFor my father, the enthusiastic past, and my daughter, the exciting future.