Raspberry Pi Projects For Dummies. Evans Jonathan

Чтение книги онлайн.

Читать онлайн книгу Raspberry Pi Projects For Dummies - Evans Jonathan страница 4

Raspberry Pi Projects For Dummies - Evans Jonathan

Скачать книгу

the two.

      If your monitor doesn’t have an HDMI input, it probably supports DVI, which has a larger, wider connector. You can buy adapters that convert from HDMI to DVI that will allow you to use your DVI monitor. You can also use a VGA monitor (the VGA input contains three rows of holes), though these aren’t officially supported. If you want to use VGA, make sure to get an adapter that is specifically meant to work with a Raspberry Pi.

      tip If you don’t want to use a computer display and you have an old TV, you can use it as a display. Your Raspberry Pi has an RCA connection, which allows you to use a composite video signal to a TV with a composite video input. The picture won’t be as sharp as with a display, and text can be hard to read, so we recommend using a monitor if you can.

      ✔ Ethernet cable: Some of the projects in this book require connecting your Raspberry Pi to a network. For these projects, you’ll need an Ethernet cable.

      ✔ Case: You can use your Raspberry Pi as is, right out of the box. It’s pretty durable, but accidents happen, so lots of people have fun making cool cases to protect the circuit board from spills and dust. Some cases are even enhanced with glowing LEDs. The designer of the Raspberry Pi logo, Paul Beech, has designed some cool cases – check out http://shop.pimoroni.com to find them.

      ✔ Mouse: Any USB mouse will work fine. The Model A only has one USB port, so if you’re using a Model A, you’ll need to use a USB hub so that you can plug in both your mouse and your keyboard. You can also plug your mouse into your keyboard, if the keyboard has an extra USB port on it.

      ✔ Keyboard: There is a USB port on the Raspberry Pi circuit board, so you can plug in a USB keyboard. If you have an older keyboard with a round (PS/2) connector, you can use it, but you’ll need a small adapter plug to convert between PS/2 and USB.

      ✔ SD card: Your Raspberry Pi doesn’t have a hard drive, so you’ll need to use some kind of external storage. An onboard SD card slot is provided for this purpose. When you plug in an SD card, your Raspberry Pi treats it just like a hard drive. SD cards are pretty cheap, so go for one with at least 8GB or 16GB of storage. SD cards have class numbers to indicate how fast they can read and write data. We recommend you get a Class 6 SD card or better.

      ✔ USB hub: If you’re using a Model A Raspberry Pi, you may need a USB hub to connect your keyboard and mouse (see the preceding bullet). If you’re using a Model B, you don’t need a USB hub, but you’ll probably want extra USB inputs into your Pi, because your keyboard and mouse will take up the two USB ports. Make sure to get a USB hub that has its own power source – the Raspberry Pi can provide only limited power output via USB.

      ✔ USB memory stick (not shown): Memory sticks (also called memory keys or flash drives) can provide a great deal of extra storage that is fast and reliable. They’re also handy for moving files from another computer or laptop to your Raspberry Pi.

      ✔ SD card writer (not shown): The Linux operating system for your Raspberry Pi is stored on an SD card. You can buy SD cards with the operating system already loaded, but you’ll probably want to write your own at some point, so you need to make sure your computer has an SD card slot. Most desktops and laptops have one these days, but if yours doesn’t, you should get an SD card writer. It plugs into your USB port and allows your computer to see what’s on the card and write files to it.

      ✔ Speakers (not shown): Your Raspberry Pi has a 3.5mm audio jack so you can plug in headphones or external speakers. If you’re using the HDMI connection and HDMI monitor as a display, the audio is sent over that cable to your screen.

      ✔ Micro USB power supply (not shown): Your Raspberry Pi gets its power via the micro USB connector on the side. You can use just about any power charger that fits this port, but it needs to supply 700 milliamperes (mA) of current (check the specifications printed on the side of the charger). Most good mobile phone chargers will work fine, as long as they supply 5V 700mA (3.5 watts). We recommend a Raspberry Pi–compatible power adapter, which should be available from the supplier of your Raspberry Pi.

       Figure 1-4: Key accessories.

      Setting Up Your Operating System

      To do anything useful with your Raspberry Pi, you need to have an operating system. The operating system provides the basic functions like the GUI, which most people know as the “desktop environment.” It also supports reading and writing files, runs general-purpose applications like your word processor and web browser, and runs the programs you write for your Raspberry Pi projects. Your Raspberry Pi uses the Linux operating system to do this.

      Your operating system is stored on an SD card, not on a hard drive like most computers. When you turn on your Raspberry Pi, it reads the operating system that’s on the SD card. If your card isn’t inserted, the Raspberry Pi won’t be able to start up, so you need to get the operating system onto an SD card before you can do anything else.

      Linux is a free operating system, unlike the ones used on Windows and Mac. It’s an open-source project, which means anyone can contribute to it – and thousands of people do. The Linux Foundation (www.linuxfoundation.org) coordinates these efforts and manages the standard Linux kernel (the core code that makes it work). All you have to do is download a copy of the operating system (see the nearby sidebar) and put it on your SD card.

      tip You also can buy premade SD cards that already have the operating system written onto them. With one of these cards, all you have to do is insert your card and power up your Raspberry Pi. You can buy them from RS, element14, Amazon, eBay, or other online outlets. If you already have one, skip to the section on setting up your hardware, later in this chapter.

      Selecting your Linux distribution

      Because it’s an open project, many different versions of Linux are out there in the wild. These are referred to as Linux distributions (or distros), and you can download them for free. The different distributions are specialized for a variety of purposes. Some are made to be as bare bones as possible; others are optimized for performance.

      The Raspberry Pi Foundation has endorsed a special distribution for beginners called Raspbian Wheezy, which is a version of the Debian Linux distribution. It includes a GUI called the Lightweight X11 Desktop Environment (LXDE). It also supports the programming languages that you use to write code for the projects in this book. Most of the projects use a scripting language called Python; some use a programming language called C. We assume you’re using Raspbian Wheezy for the projects in this book. (Tip: Your operating system is on your SD card, so if you ever want to use something other than Wheezy, you can load it onto an SD card and pop it into the SD card slot.)

      You need to download Raspbian Wheezy so you can copy it to your card. The best place to get it is from the Raspberry Pi website at www.raspberrypi.org/downloads. Click the Download ZIP button next to Raspbian Debian Wheezy and save the file on your system in a place that you can easily find it. After you download Wheezy, you’ll need to unzip the compressed file by clicking it. (Note: If you have a Mac, you don’t need to unzip the file before you create the SD card. Just follow the instructions for Mac later in this chapter.)

Скачать книгу