Raspberry Pi A Скачать руководство пользователя страница 266

P A R T   I V

  H A R D W A R E   H A C K I N G

250

ALTHOUGH YOU CAN 

use the Raspberry Pi’s general-purpose input-output (GPIO) header 

directly, as you learned in Chapter 13, “Learning to Hack Hardware”, a much better idea is to 
use a specialist prototyping board. Prototyping boards are add-on boards designed to sit 
between your project and the Raspberry Pi, and range from the relatively simple—such as 
Ciseco’s Slice of Pi—to the complex and powerful Gertboard.

At their most basic, add-on boards simply provide easier access to the Raspberry Pi’s GPIO 
pins. This may mean they can be connected to a breadboard easier, or are spaced further 
apart and labelled to make connecting other devices simpler. Some boards include circuitry 
to connect specific add-on devices, such as a small XBee wireless transceiver, and still others 
provide a small surface onto which you can solder your own components to make a custom 
board.

The hardware market is constantly and rapidly changing, and the Raspberry Pi Foundation 
continues to encourage developers to create more add-on devices. It would be impossible to 
create an exhaustive list of all the add-on boards available or planned for release in the near 
future, but in this chapter, you’ll learn about three of the most common boards and how they 
can be used.

Ciseco Slice of Pi

The most basic of boards, Ciseco’s Slice of Pi (see Figure 16-1) is nevertheless useful. Supplied 
in kit form, Slice of Pi features a small prototyping area, a space for an XBee wireless module 
and full access to the Raspberry Pi’s GPIO pins.

The compact Slice of Pi is designed to be connected directly to the GPIO headers on the top 
of the Raspberry Pi, with the rest of the board covering part of the Pi’s surface—but not 
extending beyond the edges of the board nor obscuring any commonly used ports. The Slice 
of Pi does, however, sit over the DSI video output connector. In most cases where this  
connector is used, the ribbon cable can be routed underneath the Slice of Pi board without 
trouble.

Содержание A

Страница 1: ......

Страница 2: ......

Страница 3: ...Raspberry Pi User Guide 2nd Edition...

Страница 4: ......

Страница 5: ...Raspberry Pi User Guide 2nd Edition Eben Upton and Gareth Halfacree...

Страница 6: ...d in this book are trade names service marks trademarks or registered trademarks of their respective own ers The publisher is not associated with any product or vendor mentioned in this book This publ...

Страница 7: ...Duggan Grace Fairley Technical Editors Omer Kilic Mike Cook Russell Davis Editorial Manager Jodi Jensen Editorial Assistant Annie Sullivan Marketing Associate Marketing Director Louise Breinholt Mark...

Страница 8: ...For Liz who made it all possible Eben For my father the enthusiastic past and my daughter the exciting future Gareth...

Страница 9: ...ambridge In his day job Eben works for Broadcom as an ASIC architect and general troublemaker Gareth Halfacree is a freelance technology journalist and the co author of the Raspberry Pi User Guide alo...

Страница 10: ......

Страница 11: ...on 2 18 A Bit of Background 18 ARM versus x86 19 Windows versus Linux 20 CHAPTER 2 Getting Started with the Raspberry Pi 21 Connecting a Display 22 Composite Video 22 HDMI Video 23 DSI Video 24 Connec...

Страница 12: ...5 Obtaining Software from the Pi Store 55 Obtaining Software from Elsewhere 57 Finding the Software You Want 58 Installing Software 59 Uninstalling Software 61 Upgrading Software 61 Shutting the Pi Do...

Страница 13: ...R 7 Advanced Raspberry Pi Configuration 107 Editing Configuration Files via NOOBS 108 Hardware Settings config txt 110 Modifying the Display 111 Boot Options 114 Overclocking the Raspberry Pi 114 Disa...

Страница 14: ...with the Raspberry Pi CHAPTER 11 An Introduction to Scratch 157 Introducing Scratch 158 Example 1 Hello World 159 Example 2 Animation and Sound 162 Example 3 A Simple Game 165 Robotics and Sensors 171...

Страница 15: ...uide to Soldering 213 CHAPTER 14 The GPIO Port 219 Identifying Your Board Revision 220 GPIO Pinout Diagrams 220 GPIO Features 222 UART Serial Bus 222 I2 C Bus 223 SPI Bus 223 Using the GPIO Port in Py...

Страница 16: ...gic Gertboard 257 Part V Appendixes APPENDIX A Python Recipes 265 Raspberry Snake Chapter 12 Example 3 266 IRC User List Chapter 12 Example 4 268 GPIO Input and Output Chapter 14 270 APPENDIX B Camera...

Страница 17: ...n this toolset is not available to all children Despite the most fervent wishes of my new acquaintance at the fireworks party computers don t program themselves We need an industry full of skilled eng...

Страница 18: ...m in the house and that his information and communication technology ICT classes where he shared a computer and was taught about web page design using spreadsheets and word pro cessing hadn t really e...

Страница 19: ...als that you need to get started on the long smooth curve to learning how to program your Raspberry Pi are right there waiting for you as soon as you turn it on A Bit of History I started work on a ti...

Страница 20: ...s There had been discussions at the University Computer Lab about the general state of com puter education and when I left the Lab for a non academic job in the industry I noticed that I was seeing th...

Страница 21: ...d into learning how to program by that little bit of interaction We realised that the Raspberry Pi could work as a very capable very tiny very cheap modern media centre so we emphasised that capabilit...

Страница 22: ...te port to make the Raspberry Pi work with an old cathode ray television instead since SD cards are cheap and easy to find We decided against microSD as the storage medium because the little fingernai...

Страница 23: ...y 2011 video and put up a forum on the same website shortly after that That forum now has more than 60 000 mem bers between them they ve contributed nearly 400 000 posts of wit and wisdom about the Ra...

Страница 24: ...n Pis were made in Chinese factories but in the last year we have managed to repatriate all of the production to the UK Your Raspberry Pi is now made in South Wales in an area of the country with a pr...

Страница 25: ...ing brain waves the family who are building a robot vacuum cleaner Manuel the talking Christmas moose And I m a real space cadet so reading about the people sending Raspberry Pis into near earth orbit...

Страница 26: ...R A S P B E R R Y P I U S E R G U I D E S E C O N D E D I T I O N 10...

Страница 27: ...pberry Pi Chapter 2 Getting Started with Raspberry Pi Chapter 3 Linux System Administration Chapter 4 Troubleshooting Chapter 5 Network Configuration Chapter 6 The Raspberry Pi Software Configuration...

Страница 28: ......

Страница 29: ...Chapter 1 Meet the Raspberry Pi...

Страница 30: ...next chapter to find out how to connect your Raspberry Pi to a display keyboard and mouse install an operating system and jump straight in to using the Pi A Trip Around the Board The Raspberry Pi is...

Страница 31: ...output GPIO header which can be used to connect the Pi to other hardware The most common use for this port is to connect an add on board A selection of these is described in Chapter 16 Add on Boards T...

Страница 32: ...notification respectively are present on all boards Model A The least expensive of the Raspberry Pis the Model A shown in Figure 1 2 is designed to be affordable yet flexible As well as its lower cos...

Страница 33: ...the same time you ll need to buy a USB hub to add more ports to the Model A or alternatively a key board with built in mouse functionality Model B The Raspberry Pi Model B shown in Figure 1 3 is more...

Страница 34: ...RAM It also has a slightly different GPIO header which looks identical to those of later revisions but has certain features assigned to different pins as explained in Chapter 14 The GPIO Port This is...

Страница 35: ...nboard micro USB port It s also the reason why you won t find any metal heat sinks on the device the chip s low power draw directly translates into very little waste heat even during complicated proce...

Страница 36: ...veral versions of Linux known as distributions have been ported to the Raspberry Pi s BCM2835 chip including Raspbian Pidora and Arch Linux The different distributions cater to different needs but the...

Страница 37: ...Chapter 2 Getting Started with the Raspberry Pi...

Страница 38: ...lightly from some of the images in the book as new features and options become available Connecting a Display Before you can start using your Raspberry Pi you re going to need to connect a display The...

Страница 39: ...lable on the screen If you re hoping to use the Pi with an existing computer monitor you may find that your display doesn t have an HDMI input That s not a disaster the digital signals present on the...

Страница 40: ...pur chase and are typically reserved for engineers looking to create a compact self contained system A DSI display can be connected by inserting a ribbon cable into the matched connec tor on the Pi b...

Страница 41: ...RCA phono cable is useful This provides the two white and red RCA phono connec tions that sit alongside the video connection each carrying a channel of the stereo audio signal to the TV For those con...

Страница 42: ...red USB hub passive models are cheaper and smaller but lack the ability to run current hungry devices like CD drives and external hard drives TIP If you want to reduce the number of power sockets in u...

Страница 43: ...of laptop or an add on device To begin insert the SD card into the card reader If you have previously used your SD card with another device such as a digital camera or games console follow the link on...

Страница 44: ...he Pi s SD card slot Figure 2 4 Extracting NOOBS to the SD card Connecting External Storage While the Raspberry Pi uses an SD card for its main storage device known as a boot device you may find that...

Страница 45: ...Model A the same networking capabilities as its more expensive Model B coun terpart you ll need a USB connected Ethernet adapter This connects to a free USB port on the Raspberry Pi or a connected hub...

Страница 46: ...ires a special cable known as a crossover cable In a crossover cable the receive and transmit pairs are swapped so that the two devices are prevented from talking over each other a task usually handle...

Страница 47: ...ss the Internet when it loads its operating system through the Dynamic Host Configuration Protocol DHCP This assigns the Pi an Internet Protocol IP address on your network and tells it the gateway it...

Страница 48: ...the encryption type used by your wireless network Most modern USB wireless adapters support all forms of encryption but if you re buying a second hand or older model you may find it won t connect to y...

Страница 49: ...ng the Operating System If you purchased your Raspberry Pi with a bundled SD card featuring a preloaded operating system or followed the instructions for installing NOOBS earlier in this chapter you c...

Страница 50: ...he options until you find one that works for you The chosen display mode will also be passed to the installed operating system automatically Using the keyboard or mouse browse through the list of oper...

Страница 51: ...chosen or the first in the list if you haven t booted into an OS before will automatically boot after 10 seconds For more information on using NOOBS after the operating system is installed to either...

Страница 52: ...ution you choose to download is up to you Instructions in the rest of the book will be based on the Raspbian Raspberry Pi distribution a good choice for beginners Where possible we ll give you instruc...

Страница 53: ...te the device address dev sdX where X is a letter identifying the storage device Some systems with integrated SD card readers may use the alternative format dev mmcblkX if this is the case remember to...

Страница 54: ...magefilename img with the actual name of the file extracted from the Zip archive This step takes a while so be patient Flashing from Windows If your current PC is running Windows things are slightly t...

Страница 55: ...ick the Write button to flash the image file to the SD card This process takes a while so be patient WARNING No matter which operating system you re writing from it s important to ensure you leave the...

Страница 56: ......

Страница 57: ...Chapter 3 Linux System Administration...

Страница 58: ...a collection of tools created by a group called GNU The resulting system known as GNU Linux was basic but powerful Unlike many mainstream operating systems of the era it offered facilities like multi...

Страница 59: ...NU A free software project which provides many of the tools used in Linux distri butions GRUB The GRand Unified Bootloader created by GNU and used to load the Linux kernel GUI A graphical user interfa...

Страница 60: ...cd boot will move you straight to the boot directory wherever you are mv The move command has two purposes in Linux it allows a file to be moved from one directory to another and it also allows files...

Страница 61: ...h a GUI Additional software can be quickly installed through the use of the distribution s package manager apt or pur chased through the Raspberry Pi Store link on the desktop Raspbian includes a desk...

Страница 62: ...r for files stored on the Pi or any connected storage device Galculator An open source scientific calculator offering a variety of functions for both quick and complex sums Image Viewer The GPicView l...

Страница 63: ...A graphical user interface for configuring a Raspberry Pi with optional USB Wireless Adapter to connect to a Wireless Protected System WPS encrypted network Programming IDLE An integrated development...

Страница 64: ...ich can be adjusted here Using this tool you can apply new themes to change the GUI s appearance or alter how certain aspects of the interface operate Preferred Applications A tool for changing which...

Страница 65: ...st can be installed easily using NOOBS as described in Chapter 2 Getting Started with the Raspberry Pi Next to Raspbian the most common distributions installed are RaspBMC and OpenELEC which both turn...

Страница 66: ...perating system needs to know about them In Linux this process is known as mounting If you re running a version of Linux with a desktop environment loaded like the recommended Raspbian distribution s...

Страница 67: ...t Unlike many desktop operating systems which were originally designed for use by a single individual Linux is at heart a social operating system designed to accommodate numerous users By default Rasp...

Страница 68: ...supplementary group memberships A user can be a member of as many groups as he or she pleases although only one of these can be the user s primary group This is usu ally a self named group matching t...

Страница 69: ...the SD card for storing files while others are virtual directories for accessing different portions of the operating system or hardware Figure 3 3 A directory listing for the Pi s root file system The...

Страница 70: ...uite of security utilities originally developed by the US National Security Agency sbin This stores special binary files primarily used by the root superuser account for system maintenance sys This di...

Страница 71: ...e The default software installed with the Raspbian distribution is enough to get you started but chances are you re going to want to customise your Pi according to your own requirements Obtaining Soft...

Страница 72: ...pecialist IndieCity if you already have an account on IndieCity s own website you can use this by clicking the Log In option at the top right of the Pi Store win dow and entering your email address an...

Страница 73: ...pecially if you re learning to program you may find yourself writing software of your own Whether it s a game a productivity application or even a tutorial you can quickly and easily list it for downl...

Страница 74: ...ructions A package manager s job is to keep track of all the software installed on the system It doesn t just install new software it also keeps tabs on what is currently installed allows old soft war...

Страница 75: ...t few results for an apt cache game search TIP If your search term brings up too many different packages to see on a single screen display you can tell Linux that you want it to pause on each screenfu...

Страница 76: ...es in order to operate A programming language may depend on a compiler a game engine on graphics files or an audio player on codecs for play ing back different formats These are known in Linux terms a...

Страница 77: ...e got yourself into a mess customising a particular package and it no longer works purge is the command to use For example to purge nethack console you would just type this sudo apt get purge nethack...

Страница 78: ...ut when you re finished Even when it doesn t appear to be doing anything the Pi is often reading from or writing to the SD card and if it loses power while this is happening the contents of the card c...

Страница 79: ...Chapter 4 Troubleshooting...

Страница 80: ...umentation for your keyboard or the label on its underside to see if it has a power rating given in milliamps mA This is how much power the keyboard attempts to draw from the USB port when it s in use...

Страница 81: ...ter but it can sometimes lead to the Pi failing to load or crashing at random intervals If you re looking to buy a new mouse an up to date list of models known to work with the Pi is available at the...

Страница 82: ...reating a short circuit which can damage the device Be especially careful around exposed header pins The two test points are small copper clad holes known as vias which are connected to the Pi s 5 V a...

Страница 83: ...black and white or even missing entirely First check the type of device to which the Pi is connected This is especially important when you re using the composite RCA connection to plug the Pi into a T...

Страница 84: ...ikiathttp elinux org RPi_SD_cards Sadly if you have an incompatible card you will probably need to replace it with a different card in order for the Pi to work As the Pi s software base is developed h...

Страница 85: ...onfig is split into the following sections Link encap The type of encapsulation used by the network which on the Model B will either read Ethernet for the physical network port or Local Loopback for t...

Страница 86: ...tems on the network try to talk at the same time you get a colli sion which requires them to retransmit their packets Small numbers of collisions aren t a problem but a large number here indicates a n...

Страница 87: ...uration Figure 4 3 The result of a successful test of the network using the ping command The Emergency Kernel The Linux kernel is the heart of the operating system that drives the Pi It s responsible...

Страница 88: ...altered This way if the changes to the standard kernel cause stability problems a user can simply tell the Pi to load the emergency kernel instead There are two ways to boot into the emergency kernel...

Страница 89: ...Chapter 5 Network Configuration...

Страница 90: ...information about how they should be configured is stored in a file called interfaces located in the folder etc network This is a file only the root user can edit because removing a network interface...

Страница 91: ...ols the size of the connected network in what is known as dotted quad format If you re using a home network this is typically 255 255 255 0 For gateway you should enter the IP address of your router o...

Страница 92: ...The list of DNS servers known as nameservers in Linux parlance is stored in etc resolv conf When the system gets its details through DHCP this file is automatically filled in but when you set an addre...

Страница 93: ...eless Networking Although no current models of the Raspberry Pi include Wi Fi networking hardware onboard it s possible to add wireless connectivity with a simple USB Wi Fi adapter However you will ne...

Страница 94: ...d or connecting an external storage device such as a USB flash drive To find the correct firmware file to download you ll need to know what type of wireless adapter you have Although various companies...

Страница 95: ...cantly clearer Type the following at the terminal dmesg t grep usb The symbol is known as a pipe and it tells Linux to send the output of one program which would normally go to a file or the screen to...

Страница 96: ...be apt cache search ralink If apt cache fails to find the firmware you may need to make a guess based on the firm ware packages in the following list Don t worry if you install the wrong one any firmw...

Страница 97: ...e distribution you re using and its version If you re using the recommend Raspbian distribution the firmware for the Ralink RT2x00 chipset from the example can be found by searching for firmware ralin...

Страница 98: ...ccessed from the desktop by double clicking on the icon labelled WiFi Config The main wpa_gui window has two drop down lists labelled Adapter and Network see Figure 5 4 The first should be already fil...

Страница 99: ...nnect see Figure 5 6 For an unencrypted network which is a bad thing to be running as it allows anybody within range to use your network wpa_gui will require no additional settings just click the Add...

Страница 100: ...router or access point and then click the WPS button in wpa_gui to connect automatically When you have filled in the details of your network click Add This will close the window and return you to the...

Страница 101: ...out having to remove the wireless dongle physically Simply click the Disconnect button at the bottom of the main window and after a few seconds your Pi should be removed from the network To reconnect...

Страница 102: ...can check the current status of the network using the iwconfig command Like ifconfig the iwconfig command allows you to check the status of a network interface and issue configuration commands Unlike...

Страница 103: ...gnal strength Secondary A subset of the Repeater mode which forces the wireless card to act as a backup repeater Access Point The address of the access point to which the wireless adapter is cur rentl...

Страница 104: ...ines into the etc net work interfaces file For full details on how this file is laid out see the Wired Networking section earlier in this chapter First open the file in the nano text editor sudo nano...

Страница 105: ...ple accordingly The last line of the interfaces file makes reference to a configuration file wpa conf which does not yet exist This file is used by a tool known as wpasupplicant designed to provide Li...

Страница 106: ...s network you are configuring The following subsections provide instructions for completing the configuration for unencrypted WEP and WPA networks No Encryption If your wireless network has no encrypt...

Страница 107: ...ion Figure5 11 shows an example configuration for a wireless network with the SSID Private_Router and the WPA pass phrase Private Wireless Network Save the file with CTRL O and then exit nano with CTR...

Страница 108: ...llowing the installation of a USB wireless adapter it could be due to a conflict with other USB devices Some adapter models are known to cause problems with certain USB keyboards For an up to date lis...

Страница 109: ...Chapter 6 The Raspberry Pi Software Configuration Tool...

Страница 110: ...take advantage of this most useful of configuration tools WARNING Although raspi config is designed to be safe some settings in particular the overclock option can leave your Raspberry Pi unable to b...

Страница 111: ...ply press the Right arrow key twice followed by Enter to exit back to the console or terminal Otherwise choose the option corresponding to the feature you re trying to enable or change as per the foll...

Страница 112: ...ight this option by moving the red bar with the cursor keys and then press Enter When prompted enter a new password and then confirm the change by entering the password again To exit raspi config pres...

Страница 113: ...r keys and Enter provides a list of all the languages avail able to the Pi The list is extensive and includes most common languages Use the cursor keys to scroll through the list that appears and pres...

Страница 114: ...oosing the Change Timezone menu option with the cursor keys and pressing Enter will present you with a third menu listing geographic areas like the Indian Ocean the US and Europe Use the cursor keys t...

Страница 115: ...is an interactive map of Raspberry Pi created by Ryan Walmsley It is designed to help enthusiasts in close proximity to find each other and to demonstrate areas of the world that have a large concentr...

Страница 116: ...configured overclock settings see Figure 6 3 that are known to be safe for use with most Raspberry Pis Figure 6 3 The pre set overclock options included in raspi config WARNING While the overclock set...

Страница 117: ...best performance but has been linked to SD card corruption where files become unreadable on certain Raspberry Pi models If you wish to make use of the Turbo mode make sure you have backed up any impo...

Страница 118: ...hen using the Pi s composite video output see Chapter 2 Getting Started with the Raspberry Pi with an older TV set To adjust the overscan setting highlight the Overscan option with the cursor keys and...

Страница 119: ...hlight Finish and press Enter You ll be prompted to reboot the Pi press Enter to confirm A3 Memory Split Depending on your Raspberry Pi model you will have either 512MB or 256MB of memory available to...

Страница 120: ...In the window that appears choose either Enable or Disable to turn SSH on or off Even if you don t need it it s a good idea to keep SSH enabled for future troubleshooting a better way of improving se...

Страница 121: ...oduces the tool Choosing this option with the cursor keys and pressing Enter will launch a window explaining the purpose of the tool see Figure 6 5 and will make no changes to the system The message c...

Страница 122: ......

Страница 123: ...Chapter 7 Advanced Raspberry Pi Configuration...

Страница 124: ...t way to restore them is to use the NOOBS software see Chapter 2 Getting Started with the Raspberry Pi If your operating system was installed via NOOBS you can use the tool to edit the configuration f...

Страница 125: ...C H A P T E R 7 A D V A N C E D R A S P B E R R Y P I C O N F I G U R A T I O N 109 Figure 7 1 The Edit Config button in NOOBS Figure 7 2 Editing configuration files in NOOBS...

Страница 126: ...make changes and the file isn t there just create a new text file called config txt and fill in the settings you want to change The config txt file can control almost all aspects of the Pi s hardware...

Страница 127: ...en as the number of pixels to skip overscan_right This setting does the same job as overscan_left but on the right side of the screen overscan_top Again this setting ignores a certain number of pixels...

Страница 128: ...atio common on older sets 2 14 9 aspect ratio common for smaller widescreen TVs 3 16 9 aspect ratio common for modern widescreen TVs hdmi_mode In addition to setting the video mode for the analogue co...

Страница 129: ...Forces the Pi to use a pre set collection of HDMI settings designed to provide maximum compatibility with displays connected to the HDMI port Setting this to a value of 1 is the equivalent of setting...

Страница 130: ...be loaded This can be used as a way to load the emergency kernel see Chapter 4 Troubleshooting ramfsfile The name of the initial RAM file system RAMFS to be loaded This should rarely be modified unles...

Страница 131: ...o the chip s lifespan The BCM2835 is rated by its manufacturer Broadcom to operate at a speed of 700 MHz Increasing the speed above this officially rated level may work but it will also have a deleter...

Страница 132: ...corruption As an example to overclock the CPU to 800 MHz the GPU to 280 MHz and the RAM to 420 MHz enter the following options into config txt one per line arm_freq 800 gpu_freq 280 sdram_freq 420 As...

Страница 133: ...rried out using values relative to the Pi s stock 1 2 V set ting For each whole number above zero the voltage is increased by 0 025 V from stock For each whole number below zero the voltage is decreas...

Страница 134: ...ia processor targeted at set top boxes this L2 cache is designed to be used by the GPU portion of the chip alone Unlike a traditional processor the CPU doesn t have any L2 cache of its own Using confi...

Страница 135: ...be disabled again by removing the line in config txt deleting the file alto gether or replacing the 1 with a 0 Memory Partitioning Although the Raspberry Pi has either a 256 MB or 512 MB memory chip t...

Страница 136: ...256 MB on the Model A 512 MB on the Model B should be given to the GPU with the remainder going to the CPU The value can be set to 16 MB as a minimum or 128 MB as a maximum The setting should be adju...

Страница 137: ...bps bits per second If the Pi is being used to communicate with older devices this can be reduced accordingly The kgdboc kernel option enables debugging of the Linux kernel over the serial console cr...

Страница 138: ...n will include a list of options very similar to those of cmdline txt Typically you should leave the cmdline txt file alone It s created by the distribution maintainers specifically for that version o...

Страница 139: ...Part II Building a Media Centre Productivity Machine or Web Server Chapter 8 The Pi as a Home Theatre PC Chapter 9 The Pi as a Productivity Machine Chapter 10 The Pi as a Web Server...

Страница 140: ......

Страница 141: ...Chapter 8 The Pi as a Home Theatre PC...

Страница 142: ...ity of music playback software being aimed at desktop use it can be a quiet experience but it doesn t have to be The Pi supports a powerful text based music playback package called moc which stands f...

Страница 143: ...goes back one directory level The right pane shows the current playlist Figure 8 1 The standard interface of the mocp console based music player Where the power of mocp becomes apparent is when you ex...

Страница 144: ...redmediacentresystem completewithvideoandmusicplayback photoviewing and Internet streaming capabilities It s based on the popular Xbmc distribution which has been chosen by several device manufacturer...

Страница 145: ...loaded Raspbmc automatically starts the Xbmc service see Figure 8 2 This provides a custom user interface specifically designed for living room use Everything is accessible through the keyboard or mou...

Страница 146: ...download the add on from the Internet and automatically install it into Xbmc Watch out for add ons listed as Broken these have been reported as not working correctly and should not be installed until...

Страница 147: ...ed in most modern mobile phones games consoles and network attached storage NAS devices for sharing and streaming videos music and pictures Many laptops and desktops also come with support for UPnP or...

Страница 148: ...vices which are highlighted with a red icon Choose the type of server you re try ing to connect to from the list and then click on the server that appears Figure 8 5 Choosing a network source in Xbmc...

Страница 149: ...8 7 where network settings software upgrade settings and various system settings can be adjusted Normally this menu can be ignored however if you re having problems connecting to the Internet or the R...

Страница 150: ...matters worse This same screen allows you to switch between differ ent versions of XMBC making it easy to test the nightly build and return to the default ver sion if a problem is found Finally the S...

Страница 151: ...Chapter 9 The Pi as a Productivity Machine...

Страница 152: ...memory for general purpose use and less for the graphics processor To learn how to change this split see Chapter 6 The Raspberry Pi Software Configuration Tool Using Cloud Based Apps If you use your P...

Страница 153: ...paid account You can access the service at http www zoho com Office 365 If you re a Microsoft Office user Office 365 is a great choice Based on the same user interface as the current editions of the...

Страница 154: ...the Chromium browser under Raspbian open a terminal and type the following sudo apt get install chromium browser TIP Make sure you install the chromium browser package and not the chromium package th...

Страница 155: ...bian distribution has less free space available on the SD card than LibreOffice requires For more information on the partition layout of the Raspbian distribution see the File System Layout section in...

Страница 156: ...e Math A small yet powerful package designed to make it easy to create and edit scientific formulae and equations for embedding in other LibreOffice programs LibreOffice Writer The word processor appl...

Страница 157: ...ffice Draw is a powerful tool for illustrative work unfortunately you can t use it to touch up digital photographs These are known as bitmapped images and are very different to the vector images Draw...

Страница 158: ...s up a not inconsiderable amount of space on the SD card If you try to access the manual by pressing the F1 key or choosing Help from the Help menu you ll be prompted to read an online web based versi...

Страница 159: ...C H A P T E R 9 T H E P I A S A P R O D U C T I V I T Y M A C H I N E 143 Figure 9 4 Exporting a file from The Gimp...

Страница 160: ......

Страница 161: ...Chapter 10 The Pi as a Web Server...

Страница 162: ...ationTool and don t run a graphical user interface GUI at the same time Installing a LAMP Stack If you re running the recommended Raspbian distribution for the Raspberry Pi you re already one quarter...

Страница 163: ...ally identifiable information Also make sure you pick a password you can remember You ll be asked to confirm the password to check for typing errors and then the installation will continue Figure 10 1...

Страница 164: ...or the section corresponding to the network adapter in use on your Pi if you re not using the Model B s built in Ethernet port For more information on checking and adjusting network settings on the Pi...

Страница 165: ...emove the phptest php file with the following command sudo rm var www phptest php TIP Although Apache is the most common web server there are others If you find the performance of Apache too slow expe...

Страница 166: ...ressontheRaspberryPi typethefollowingcommandattheterminalorconsole sudo apt get install wordpress Like the LAMP stack WordPress comes with a selection of dependencies see Figure 10 5 You ll need to ma...

Страница 167: ...tabase stores your user accounts posts comments and other details Once this script has completed you ll be told to visit http localhost in a browser on the Raspberry Pi to continue the installation Th...

Страница 168: ...to complete and then a new page confirm ing the successful installation of WordPress will load in the browser To start using WordPress click the Log In button at the bottom of this page to log into Wo...

Страница 169: ...ig 192 168 0 115 php To complete configuration for external access choose General from the Settings menu that s located on the left side of the WordPress Dashboard and change the URL to match either t...

Страница 170: ...dd new features However when installed via APT WordPress lacks the permissions required to keep itself up to date To correct this type the following command at the terminal sudo chown R www data usr s...

Страница 171: ...Part III Programming with the Raspberry Pi Chapter 11 An Introduction to Scratch Chapter 12 An Introduction to Python...

Страница 172: ......

Страница 173: ...Chapter 11 An Introduction to Scratch...

Страница 174: ...d its colour ful and mouse driven user interface is a programming language that includes impressive multimedia functionality It should come as no surprise then that of the more than two and a half mil...

Страница 175: ...on on the desktop or clicking on its entry in the Programming menu After a few seconds the main Scratch interface will appear see Figure 11 1 If it s off centre or small click the Maximise button the...

Страница 176: ...the window labelled Scripts To obey the decades of tradition behind this type of program you can also click on the block where it says Hello and customise it to read Hello World if you so desire see...

Страница 177: ...onnector that fits into the top of other bricks which indicates that more bricks can be placed underneath With the two bricks in place click the green flag icon at the top right of the screen again Th...

Страница 178: ...begin start a new project in Scratch by either loading the program afresh or choosing New from the File menu As with any starter project Scratch will provide a default sprite it s this sprite that you...

Страница 179: ...ion To make it so the program can be run multiple times without the cat sprite disappearing off the edge of the stage add another move 10 steps block beneath the play sound block and modify it to read...

Страница 180: ...f an animated comic strip More importantly even this simple example teaches important programming concepts despite being a mere five blocks long it covers sprite movement in positive and negative dist...

Страница 181: ...d Click the down arrow button next to the word space to see a list of all the keys the block can watch and then select right arrow from the list to change the block into a when right arrow key pressed...

Страница 182: ...can have its own code attached and that each section of code runs simultaneously and independently of any other block Used properly these features enable you to create some quite complex programs By...

Страница 183: ...w keys on the keyboard to move the cat sprite towards the Cheesy Puffs sprite now As you can see when the two sprites meet nothing happens That s because the program doesn t contain any instructions f...

Страница 184: ...when this point is reached any code located within its confines will be executed if and only if the condition is met In this case the condi tion is that Sprite2 is being touched by Sprite1 With the u...

Страница 185: ...click the cat sprite on the stage to return to editing its scripts The script you created for the Cheesy Puffs sprite will disappear but don t worry it s still saved but only appears when you re editi...

Страница 186: ...rogramming concepts it s hardly the best way the game could be coded Scratch includes a message broadcast system that allows code attached to one object to communicate with code attached to another wh...

Страница 187: ...ernal electrical devices There are currently two types of PicoBoard the original model which uses a serial connec tion and its replacement which uses a USB connection The latter is supported by the Ra...

Страница 188: ...ch MIT also runs a user forum for Scratch allowing enthusiasts of the software to learn together and share solutions for common problems Membership is free and the site works well using the Midori web...

Страница 189: ...Chapter 12 An Introduction to Python...

Страница 190: ...on make it a valuable tool for anyone who wants to learn to program It is also the language that is recommended by the Raspberry Pi Foundation for those looking to progress from the simple Scratch des...

Страница 191: ...o begin the Hello World project open IDLE from the Programming menu in the Raspbian distribution s desktop environment If you re not using IDLE create a blank document in your favourite text editor an...

Страница 192: ...inal window To achieve the goal of printing out a message you should use Python s print command As its name suggests this command prints text to an output device by default to the console or terminal...

Страница 193: ...tor In IDLE simply choose Run Module from the Run menu or press the F5 key on the keyboard This will switch IDLE back to the Python shell window and run the program You should then see the message Hel...

Страница 194: ...system to run Python and then load the helloworld py file for execution Unlike the Python shell in IDLE Python will quit when it reaches the end of the file and return you to the terminal The result h...

Страница 195: ...the following helloworld py Despite the fact that you didn t call the Python program the helloworld py program should run just the same as if you d typed python helloworld py The program can only be r...

Страница 196: ...at this needs to be entered as a single line as with all code lines that end in a symbol Example 2 A Python program from the Raspberry Pi User Guide In Python anything following a hash symbol with the...

Страница 197: ...elcome the user using the following line print Welcome to the program userName This line demonstrates a secondary function of the print command introduced in Example 1 the ability to print out the con...

Страница 198: ...inus secondNumber equals firstNumber secondNumber print firstNumber multiplied by secondNumber equals firstNumber secondNumber Notice that while the addition and subtraction operations use the expecte...

Страница 199: ...n is no longer true goAgain is no longer equal to 1 and the loop will end The finished program should look like this remembering that anything marked with should be entered onto a single line usr bin...

Страница 200: ...nally written by Pete Shinners pygame is a collection of python modules designed to add new functionality to the language functionality specifically designed to make it easy to write a game in Python...

Страница 201: ...lled by typing its name followed by a full stop and the name of the instruction from within the module but the second line in the preceding code tells Python to load all the instructions from the pyga...

Страница 202: ...aspberry Position are set to a list of comma separated values This causes Python to create the variables as lists a number of different values stored in a single variable name Later you ll see how you...

Страница 203: ...ing to evaluate Python will check to see if True is true Because that s always the case the loop will continue to run forever or at least until you tell Python to quit out of the loop by calling the g...

Страница 204: ...event post pygame event Event QUIT These instructions modify the value of the changeDirection variable used to control the direction the player s snake is travelling during the game Using or with an i...

Страница 205: ...s value minus the new value By way of example snakePosition 0 20 is a shorthand way ofwriting snakePosition 0 snakePosition 0 20 Thenumberinsquarebrackets following the snakePosition variable name is...

Страница 206: ...ut clever it returns the oldest value from the list but also removes it making the list one item shorter In the case of the snakeSegment list it tells Python to delete the portion of the snake s body...

Страница 207: ...w the snake s head and body segments in white and finally draw a raspberry in red The last line pygame display flip tells pygame to update the screen without this instruction items will be invisible t...

Страница 208: ...am the game would run too quickly to play Type in the following line to finish the program fpsClock tick 20 If you think the game is too easy or too slow you can increase this number or if the game is...

Страница 209: ...the shebang line along with a comment describing the purpose of the program usr bin env python IRC Channel Checker written for the Raspberry Pi User Guide by Tom Hudson Next import the modules require...

Страница 210: ...nal line The host variable should be set to the fully qualified domain name FQDN of the IRC server to which the program will connect In this example chat freenode net is used but if you want to custom...

Страница 211: ...port s irc sys exit 1 The try and except commands are included in this code for error handling If the system fails to connect to the server because the Pi isn t connected to the Internet for example o...

Страница 212: ...e processed Initialise the buffer by typing in the following line read_buffer Note that there are two single quotes after the equals sign not one double quote Next create an empty list which will be u...

Страница 213: ...nse_code RPL_NAMREPLY names_list response 3 split 1 names names_list split This runs through every line found in the lines variable and looks for the numerical IRC response code provided by the server...

Страница 214: ...r n irc This tells Python to wait the namesinterval number of seconds before sending another request for user names and beginning the loop again Be careful to set namesinterval to a reasonable value i...

Страница 215: ...ly in your browser is available for download at http www learnpython org Zed A Shaw s Learn Python The Hard Way Shavian Publishing 2012 offers great insight into best practice coding for Python and de...

Страница 216: ......

Страница 217: ...Part IV Hardware Hacking Chapter 13 Learning to Hack Hardware Chapter 14 The GPIO Port Chapter 15 The Raspberry Pi Camera Module Chapter 16 Add on Boards...

Страница 218: ......

Страница 219: ...Chapter 13 Learning to Hack Hardware...

Страница 220: ...controlled by the Pi s GPIO port you ll need various components and tools The following list provides a sample shopping list for getting started with electronics Breadboard An electronic breadboard pr...

Страница 221: ...t a component permanently into a circuit you need to solder it You don t have to spend a fortune on a soldering iron but if your budget stretches to a temperature controlled model it s a wise investme...

Страница 222: ...nts cheaply Reading Resistor Colour Codes Most electronic components are clearly labelled For example capacitors will have their capac itance measured in farads printed directly on them while crystals...

Страница 223: ...o the initial reading is 22 The next band is green which is the multiplier and equates to 105 or 100 000 10 followed by five zeros Multiplying 22 by 100 000 equals 2 200 000 which is the resistance va...

Страница 224: ...book while considering the purchase of a Raspberry Pi you ll have ordered the device from one of the two Both RS Components and Farnell focus on business to business transactions meaning that their ma...

Страница 225: ...because the company relies on mark up rather than high volume trade to make a profit In the US and other countries Radio Shack remains the most popular chain of electronics stores Founded in 1921 and...

Страница 226: ...ike the larger retailers oomlout equips its components with all necessary extras such as pull up resistors for the push buttons and a circuit schematic for easy assembly Where possible sample source c...

Страница 227: ...onic components placed into these holes stay in place instead you ll have to solder them onto the stripboard Stripboard is often referred to by the trade name Veroboard which is a trademark of Vero Te...

Страница 228: ...use of wires to join components together electrically Stripboard can be made in different thicknesses and with different materials and one type of stripboard may be more suited to a particular projec...

Страница 229: ...ief Guide to Soldering Having a soldering iron is one thing but you also need to know how to use it Soldering like any skill takes practice to become proficient If you follow the tips in this section...

Страница 230: ...ne works just as well Don t be tempted to use a few sheets of cheap newspaper solder can burn through thin paper before it cools Figure 13 4 An example soldering work area with a protective antistatic...

Страница 231: ...merical tempera ture read out See the operating manual that came with your soldering iron to find out how temperatures are indicated on it Once the operating temperature has been reached it s time to...

Страница 232: ...ished joint will be bad 3 It takes only a few seconds for the area to heat up Count to three and then push the solder against the component and copper contact see Figure 13 6 If the solder doesn t mel...

Страница 233: ...ng only one surface results in what is known as a dry joint or cold joint where the solder is not properly mated to one surface Over time these joints will fail and need to be re soldered As with any...

Страница 234: ......

Страница 235: ...Chapter 14 The GPIO Port...

Страница 236: ...two rows of four copper plated holes the Revision 1 is solid Another method is to see how much memory is available the Model B Revision 1 had just 256 MB of memory compared to 512MB on Revision 2 boa...

Страница 237: ...C H A P T E R 1 4 T H E G P I O P O R T 221 Figure 14 1 The Raspberry Pi s GPIO port and its pin definitions Figure 14 2 The original Raspberry Pi Model B Revision 1 GPIO pinout...

Страница 238: ...turn other components on or off You ll learn more about this later in the chapter WARNING The Pi s internal logic operates at 3 3 V This is in contrast to many common microcontroller devices such as...

Страница 239: ...bus is available on Pins 19 21 and 23 with a pair of Chip Select lines on Pin 24 and Pin 26 Pin 19 provides the SPI Master Output Slave Input MOSI signal Pin 21 provides the SPI Master Input Slave Out...

Страница 240: ...rd current of your LED This is the maximum current the LED can draw before being damaged and is measured in milliamps mA You ll also need to know the forward voltage of the LED This latter value measu...

Страница 241: ...w as the long leg of the LED 4 Using another jumper wire connect Pin 6 of the Raspberry Pi s GPIO port or the cor responding pin on an interface board connected to the GPIO port to the row that contai...

Страница 242: ...the following line to the project import time With the libraries imported it s time to address the GPIO ports The GPIO library makes it easy to address the general purpose ports through the instructi...

Страница 243: ...nite loop in the program while True Next add the following lines to switch the pin on wait two seconds and then switch it off again before waiting another two seconds Make sure each line starts with f...

Страница 244: ...current limiting resistor is too large the LED won t light up Although this example is basic it s a good demonstration of some fundamental concepts To extend its functionality the LED could be replace...

Страница 245: ...button switch to Pin 6 of the Raspberry Pi s GPIO port This provides the ground connection 5 Finally connect Pin 12 of the Raspberry Pi s GPIO port to the other leg of the push button switch in the sa...

Страница 246: ...n t need any timing instructions Instead you can get right to enabling board mode and setting up Pin 12 as an input This is done in the same way as setting a pin as an output with just the final part...

Страница 247: ...on add the following print instruction to get feedback if input_value False print The button has been pressed while input_value False input_value GPIO input 12 The last two lines the second while and...

Страница 248: ...read when the pins of a separate device such as a sensor or external microcon troller have been pulled high or low By extending the code to look for multiple push buttons each on an individual GPIO pi...

Страница 249: ...Chapter 15 The Raspberry Pi Camera Module...

Страница 250: ...rack a user s face or hand gestures The module has even reached near space as the result of photography projects that tether a Raspberry Pi to a weather balloon and release it to gather high altitude...

Страница 251: ...e Pi through a ribbon cable a thin semi rigid cable that should be inserted into the Raspberry Pi s CSI connector When you receive the camera one end of the cable will already be inserted into the mod...

Страница 252: ...P A R T I V H A R D W A R E H A C K I N G 236 Figure 15 2 The Raspberry Pi s CSI connector pictured on a Model A Figure 15 3 Raising the lugs of the CSI connector prior to inserting the ribbon cable...

Страница 253: ...tor WARNING The ribbon cable included with the Raspberry Pi Camera Module is reasonably robust and will prove reliable even in daily use It is however susceptible to damage if folded When inserting th...

Страница 254: ...will need to change some system settings in order for the Camera Module to work cor rectly however In particular recording video requires that the graphics processing portion of the Pi s BCM2835 proc...

Страница 255: ...captured images from the Raspbian console without having to load the graphical user interface is to install the framebuffer image viewer fbi To do this type the following command sudo apt get install...

Страница 256: ...of the camera the file type saved and the level of compression applied to the final image If these options are left out of the command defaults will be used To test the camera simply run the raspistil...

Страница 257: ...only used options adjusts the width and height of the captured image This is good for capturing low resolution stills as part of a computer vision project or simply to save space The width of the capt...

Страница 258: ...istill the t option provided the time out for the preview before the image was captured in raspivid the t option provides a limit for the overall length of the recorded video If a value of 0 is given...

Страница 259: ...ble options with the following command raspivid help Command Line Time Lapse Photography So far you ve learned the basics of how to use the Raspberry Pi Camera Module now it s time to find a practical...

Страница 260: ...tiple programs together shell scripting is a pow erful tool To start a shell script simply create a new text file in your current directory with the follow ing command nano timelapse sh The extension...

Страница 261: ...been taken Enter the following two lines to start the loop while true do Note that the second line do is indented by typing four spaces at the start this helps visu ally illustrate that the code that...

Страница 262: ...ect a USB network adapter In this case the date in the filename will be wrong unless you manually set a date before running the script With the filename set it s time to tell the script to run raspist...

Страница 263: ...image every 30 seconds Save the file by pressing Ctrl O and then change the file s permissions to make it executable with the following command chmod x timelapse sh For more information on file permi...

Страница 264: ...ol While ffmpeg can be run on the Raspberry Pi itself it s a resource hungry program that will take a considerable time to run if you have a large number of high resolution images to convert If you ha...

Страница 265: ...Chapter 16 Add on Boards...

Страница 266: ...stom board The hardware market is constantly and rapidly changing and the Raspberry Pi Foundation continues to encourage developers to create more add on devices It would be impossible to create an ex...

Страница 267: ...abelling on the circuit board which the GPIO header lacks and the use of female headers These allow you to use male to male jumper leads or even just lengths of trimmed wire to connect the board to a...

Страница 268: ...ing the Pi in an embedded computing project When combined with a compatible trans ceiver such as an XBee RF BEE or RN XV module it allows for wireless access to the Pi s UART serial port Such access c...

Страница 269: ...t can damage the Pi s 3 3 V logic circuits The labelling is also different to that used to typically describe the Raspberry Pi s GPIO pins which can lead to confusion when using a GPIO library not wri...

Страница 270: ...pins see Figure 16 4 Unlike the Slice of Pi however the Prototyping Pi Plate is a full coverage board built to the same size as the Pi itself As a result the plate offers a much larger area to work w...

Страница 271: ...connectivity The sec ond half of the prototyping surface does not have such tracks allowing more custom circuits to be constructed Overall the surface provided for circuit creation is significantly l...

Страница 272: ...onnectors Because it only increases the height of the Pi rather than the width or length and because it includes the screw terminals for side on access to GPIO pins it s also compatible with a surpris...

Страница 273: ...rful and versatile platform for electronic tinkering Unlike the Slice of Pi and Prototyping Pi Plate the Gertboard is an active add on board with numerous components designed to extend the functionali...

Страница 274: ...a ribbon cable ter minated in male sockets see Figure 16 8 This cable allows the Gertboard to sit away from the Pi or to be mounted in a project permanently yet still be quickly detached from the Pi...

Страница 275: ...to control surprisingly powerful motors either through instructions received from the Pi itself or from the optional Atmel microcontroller module Figure 16 9 shows an example circuit that s using the...

Страница 276: ...he Pi s volume in a media centre applica tion or to alter the speed of an attached motor The DAC pins provide the opposite functional ity taking a digital signal from the Pi and converting it to analo...

Страница 277: ...ertboard is designed to operate with an Atmel ATmega168 or ATmega328 microcon troller the same type of microcontroller used in the Arduino prototyping project When fitted you can write programs for th...

Страница 278: ...the Slice of Pi will usually be enough However for in depth experimentation of just what is possible with the Raspberry Pi s BC2835 processor and or to ensure that you ll be able to interface almost...

Страница 279: ...Part V Appendixes Appendix A Python Recipes Appendix B Camera Module Quick Reference Appendix C HDMI Display Modes...

Страница 280: ......

Страница 281: ...Appendix A Python Recipes...

Страница 282: ...Raspberry Snake Chapter 12 Example 3 usr bin env python Raspberry Snake Written by Gareth Halfacree for the Raspberry Pi User Guide import pygame sys time random from pygame locals import pygame init...

Страница 283: ...QUIT if changeDirection right and not direction left direction changeDirection if changeDirection left and not direction right direction changeDirection if changeDirection up and not direction down di...

Страница 284: ...if snakePosition 0 620 or snakePosition 0 0 gameOver if snakePosition 1 460 or snakePosition 1 0 for snakeBody in snakeSegments 1 if snakePosition 0 snakeBody 0 and snakePosition 1 snakeBody 1 gameOve...

Страница 285: ...user s send USER username s hostname s servername s realname s r n user s send JOIN channel s r n irc s send NAMES channel s r n irc read_buffer names while True read_buffer s recv 1024 lines read_buf...

Страница 286: ...import RPi GPIO as GPIO GPIO setmode GPIO BOARD GPIO setup 11 GPIO OUT GPIO setup 12 GPIO IN GPIO output 11 False while True input_value GPIO input 12 if input_value False print The button has been p...

Страница 287: ...Appendix B Raspberry Pi Camera Module Quick Reference...

Страница 288: ...htness Brightness Adjusts the brightness of the captured image or video Possible values for this option are whole numbers ranging from 0 minimum brightness to 100 maximum brightness cfx or colfx Colou...

Страница 289: ...a number of preconfigured special effects on the image or video Possible values for this option are none negative solarise sketch denoise emboss oilpaint hatch gpen pastel watercolour film blur satura...

Страница 290: ...ues for this option are whole numbers ranging from 100 minimum sharpness to 100 maximum sharpness t or timeout Capture Timeout Controls the timeout in milliseconds that the pre view window will appear...

Страница 291: ...e output of the camera s Bayer colour filter as metadata in the JPEG image and has no effect when using any other encoding for mat This extra data the output of the camera s sensor without interpolati...

Страница 292: ...sk space Recording at a rate above 30 frames per second which can be turned into slow motion video with a video editing application will likely only work at lower resolutions set with the width and he...

Страница 293: ...Appendix C HDMI Display Modes...

Страница 294: ...40p 60Hz 16 9 aspect ratio 10 480i 60Hz Pixel quadrupling enabled 11 480i 60Hz Pixel quadrupling enabled 16 9 aspect ratio 12 240p 60Hz Pixel quadrupling enabled 13 240p 60Hz Pixel quadrupling enabled...

Страница 295: ...ct ratio 37 576p 50Hz Pixel quadrupling enabled 38 576p 50Hz Pixel quadrupling enabled 16 9 aspect ratio 39 1080i 50Hz Reduced blanking 40 1080i 100Hz 41 720p 100Hz 42 576p 100Hz 43 576p 100Hz 16 9 as...

Страница 296: ...85Hz 13 800 600 120Hz 14 848 480 60Hz 15 1024 768 43Hz incompatible with the Raspberry Pi 16 1024 768 60Hz 17 1024 768 70Hz 18 1024 768 75Hz 19 1024 768 85Hz 20 1024 768 120Hz 21 1152 864 75Hz 22 1280...

Страница 297: ...050 85Hz 45 1400 1050 120Hz Reduced blanking 46 1440 900 Reduced blanking 47 1440 900 60Hz 48 1440 900 75Hz 49 1440 900 85Hz 50 1440 900 120Hz Reduced blanking 51 1600 1200 60Hz 52 1600 1200 65Hz 53 1...

Страница 298: ...0 85Hz 72 1920 1200 120Hz Reduced blanking 73 1920 1440 60Hz 74 1920 1440 75Hz 75 1920 1440 120Hz Reduced blanking 76 2560 1600 Reduced blanking 77 2560 1600 60Hz 78 2560 1600 75Hz 79 2560 1600 85Hz 8...

Страница 299: ...ard 257 262 ad hoc mode iwconfig command output 87 AES Advanced Encryption Standard mode WPA 89 alpha channel 112 and operator 168 animations Scratch 162 164 antistatic workmat 214 Apache servers 146...

Страница 300: ...ournalist 5 6 central processing unit CPU 103 104 119 120 changeDirection variable Python 188 channel variable Python 194 children LEGO robotics kits 171 programming opportunities lack 1 3 Scratch pro...

Страница 301: ...5 CTS Clear To Send handshaking 87 current limiting resistors 224 D daemons 148 data storage 27 date command raspistill package 245 246 dd command 36 37 38 Debian distribution 49 Debian Reference guid...

Страница 302: ...VI Digital Video Interconnect monitors 23 25 dwg_otc lpm_enable option cmdline txt file 121 Dynamic Host Configuration Protocol DHCP 31 74 77 E e option camera 241 electronic components sourcing 208 2...

Страница 303: ...18 220 Output program example Python 223 228 270 pinout diagrams 220 222 Gertboard 257 262 GIF Graphic Interchange Format file format 241 The Gimp GNU Image Manipulation Program 141 143 GNOME desktop...

Страница 304: ...txt file 112 hdmi_force_hotplug setting config txt file 112 hdmi_group setting config txt file 113 hdmi_mode setting config txt file 112 hdmi_safe setting config txt file 113 HDTV high definition tele...

Страница 305: ...c variable Python 194 ircuserlist py program 193 199 ISA instruction set architecture 19 ISP in system programming 223 isp_freq setting config txt file 116 iwconfig command 86 iwlist command 85 J JPEG...

Страница 306: ...output 87 Maplin Electronics website 209 mask ifconfig tool output 70 Math LibreOffice 140 maximum transmission unit 70 media streaming 129 132 Media Access Control MAC address 69 media directory 54...

Страница 307: ...B Wi Fi adapters 31 32 77 78 92 wpa_gui tool 82 85 New Out Of Box Software NOOBS 27 28 33 35 108 109 NFS Network File System standard 131 nick variable Python 194 nightly build XBMC 134 non volatility...

Страница 308: ...photography editing with The Gimp 142 143 still 239 242 time lapse 243 248 video 242 243 PHP scripting module 148 150 phptest php file 148 149 physical layout 54 55 pi normal user account 51 Pi Store...

Страница 309: ...dule Python 185 Raspberry Pi camera module 234 248 community 7 8 damage due to careless GPIO connections 222 225 history 3 8 Linux distributions 20 36 49 61 Model A 16 17 Model B 17 18 mounting extern...

Страница 310: ...mdline txt file 122 RS Components website 208 RTS iwconfig command output 87 RTS Ready To Send handshaking 87 RX ifconfig tool output 70 RX bytes TX bytes ifconfig tool output 70 S s flag 128 safety s...

Страница 311: ...rface 204 223 SPI Master Input Slave Output MISO signal 223 SPI Master Output Slave Input MOSI signal 223 split function Python 197 sponge soldering 205 215 spreadsheets 140 sprites Scratch adding spe...

Страница 312: ...64 65 missing files on software install 139 network 68 71 power supply 65 67 USB wireless adapters 92 try command Python 195 ttyAMA0 serial console 121 TVs composite video 22 23 DSI video 24 HDMI vide...

Страница 313: ...I receive block Scratch 170 when left arrow key pressed block 165 when right arrow key pressed block 165 when space key pressed block Scratch 165 Wi Fi See wireless networking Wi Fi Protected Setup W...

Страница 314: ...R A S P B E R R Y P I U S E R G U I D E 2 N D E D I T I O N 298 Y yum tool 58 Z Zeroconf standard 131 000 default file 150 Zip archive defined 27 36 Zoho 137...

Отзывы: