Raspberry Pi For Dummies. McManus Sean. Читать онлайн. Newlib. NEWLIB.NET

Автор: McManus Sean
Издательство: John Wiley & Sons Limited
Серия:
Жанр произведения: Зарубежная образовательная литература
Год издания: 0
isbn: 9781119412021
Скачать книгу
3-2.) If you have earphones or headphones from a portable music player, you can plug them directly into this socket.

Alternatively, you can plug a suitable cable into this socket to feed the audio into a television, stereo, or PC speakers for a more impressive sound. Figure 3-11 shows such a cable with the Pi’s 3.5mm audio jack on the right of the picture, and the two stereo plugs that feed audio into many stereos shown on the right. The cable you need might be different, depending on the input sockets on your audio equipment.

image

       FIGURE 3-11: A cable for connecting your Raspberry Pi to your stereo.

      If you’re using PC speakers, note that they need to have their own power supply.

      Connecting to Your Router

      The Raspberry Pi Model A, A+, and Zero have no wired network connection on the board. The other Raspberry Pi models have an Ethernet socket on the right edge of the board, indicated in Figures 3-1 and 3-2. Use this socket to connect your Raspberry Pi to your Internet router with a standard Ethernet cable.

      The Raspberry Pi automatically connects to the Internet when used with a router that supports the Dynamic Host Configuration Protocol (DHCP), which means it works with most domestic routers. For advice on troubleshooting your Internet connection, see Appendix A.

      If you have a Wi-Fi adapter, you can plug it into a USB socket so that it's ready for when you switch on your Raspberry Pi.

      Connecting the Power and Turning on the Raspberry Pi

      The last thing you should do is connect the power. The Micro USB power socket is indicated in Figures 3-1, Figure 3-2, and 3-3.

      warning The Raspberry Pi Foundation warns against using battery power unless you know what you’re doing, because it’s easy to damage your Pi unless you provide a steady 5 volts (5v) of power. Some cellphone emergency battery chargers can be used to provide that steady power, but you should proceed with caution.

      The Raspberry Pi has no on/off switch, so when you connect the power, it starts working. To turn it off again, you disconnect the power. To avoid losing data, you should shut down first (see Chapters 4 and 5) and wait for that process to finish. Sean plugs his USB hub and Raspberry Pi into power sockets on an extension lead, so he can switch them both on simultaneously by switching on the power to that extension lead. It’s less clumsy than removing or inserting the plug in the wall socket or the power lead in the Raspberry Pi all the time. It can also help to prevent backpowering, where the USB hub feeds power back into the Raspberry Pi with the possible risk of causing damage to your Pi if there is a power surge.

      remember If you’re using the Lite version of NOOBS, you need a network connection to download the operating system you wish to install. You can plug a network cable into the Ethernet port on the Pi, configure the onboard Wi-Fi on the Raspberry Pi 3 Model B or Pi Zero, or plug a Wi-Fi dongle into a USB port. You will be prompted to set this up when NOOBS runs, but you can get back to the settings by clicking the onscreen Wi-Fi networks button or pressing W on the keyboard.

When you switch on your Raspberry Pi, the screen shows a rainbow of color briefly and then starts to run the NOOBS software on the SD or MicroSD card, as shown in Figure 3-12. The software gives you a choice of operating systems to install, and language and keyboard options at the bottom of the screen.

image

       FIGURE 3-12: Your operating system choices in NOOBS.

      To select an operating system, select the box beside it. The options in NOOBS Lite include:

      ❯❯ Raspbian: The distribution that the Raspberry Pi Foundation recommends is called Raspbian. It’s a version of a Linux distribution called Debian that has been optimized for the Raspberry Pi. It includes graphical desktop software (see Chapter 4), a web browser (see Chapter 4), and various development and programming tools. This is the quickest way to get up and running with your Raspberry Pi, and for most users, this is the one you’ll want to use. For the rest of this book, except where noted otherwise, we assume you’re using Raspbian. There are two versions available: one with the PIXEL desktop and one that is a more minimal installation (called Raspbian Lite). We recommend that you choose the one with the desktop unless you need the other one for a particular project.

      ❯❯ LibreELEC and OSMC: These are versions of the Kodi media center for playing music and video. See Chapter 8 for a guide to using this.

      ❯❯ RISC OS: Most people run Linux on the Raspberry Pi, but you can also use an alternative operating system called RISC OS, which has a graphical user interface. RISC OS dates back to 1987, when Acorn Computers created it for use with the upmarket Archimedes home computer. Today it’s maintained and managed by RISC OS Open Limited. At the time of writing, RISC OS is not available in NOOBS if you are using a Raspberry Pi 3, but you can download it and prepare your own SD or MicroSD card (see the section on flashing a card in Chapter 2). See Appendix B on this book’s companion website for some tips on getting started with RISC OS.

      ❯❯ Data partition: This option adds a data partition you can use for storing data that can be accessed by different Linux distributions.

      ❯❯ Lakka: This retrogaming system includes emulators for a range of vintage home computers (including the Commodore 64 and Amiga, Amstrad CPC, various Atari machines, and the ZX Spectrum), as well as game consoles (including a number of Nintendo machines and the Sony PlayStation). The Multi Arcade Machine Emulator (MAME) option can be used to play games from classic coin-operated arcade machines, too. To use Lakka, you'll need to get the games separately, unless you want to play the 2048 and Bomberman clones that are included (among the game system cores). A number of games have been released by their creators for free distribution online (including games for MAME at http://mamedev.org/roms, and Sean's Amstrad games at www.sean.co.uk/books/amstrad/index.shtm).

      The easiest way to get games into Lakka is to plug in a USB key with the game files on it. In the menu system, you use the cursor keys to move, Enter to select, and the Backspace (Delete) key to go back. In the Lakka jargon, a game system is called a core, and a game is called content, so start by choosing Load Content from the main menu. Choose Start Directory, and then choose your USB key to see the games on it. You'll be given a choice of which core you want to use your chosen game in. If you're using MAME, press 5, 6, 7, or 8 to insert a coin (for player 1, 2, 3, or 4), and then press Enter or a number from 1 to 4 (for the number of players) to start. Cursor keys move, and the Fire keys can vary by game (try Z, X, space and the Ctrl, Alt, and Shift keys for Player 1). You can quit your game and return to the main menu by pressing the Esc key. If you’re using keyboard controls, you may find that your game doesn't work correctly, because Lakka uses many keys to control factors like the emulator speed. To reconfigure the keys that Lakka uses, return to the main menu, tap the right arrow to get to the