Raspberry Pi For Dummies. Sean McManus

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

Читать онлайн книгу Raspberry Pi For Dummies - Sean McManus страница 14

Raspberry Pi For Dummies - Sean McManus

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

Compute Module, or C for short, is designed for industrial use and intended to be built into a product you’re manufacturing. The modules tend to follow the release of the main Raspberry Pi models. There are also light versions available that correspond to the Model A of the Raspberry Pi. They’re built on a SODIMM board, which is what is sometimes used for PC memory modules. You’re supposed to design your own board to plug the Compute Module into, but a development kit is available with a C module and an example motherboard containing all the normal plug-in connectors (see www.raspberrypi.org/products/compute-module-development-kit-2). Note, however, that this is an expensive way to buy what is otherwise a normal Raspberry Pi. Currently, the Raspberry Pi Compute Module 4 is the latest one, but the dev kit uses the Compute Module 3.

      We only mention the Compute Module here in case you wonder what it is: It’s not covered further in this book, and it’s almost certainly not what you want to buy for your first Raspberry Pi.

      The Raspberry Pi Pico is a radical new departure for the Raspberry Pi Foundation. Whereas previous devices were general-purpose computers, Raspberry Pi Pico is a microcontroller. A microcontroller is usually built into a device that does one job, such as a heating system or a microwave oven.

      You can use the Raspberry Pi Pico for your electronics projects. You program it by connecting it to a computer. It’s similar to the Arduino, which you might have heard of, but the Pico uses the Raspberry Pi Foundation’s own custom chip.

      The big advantage of a microcontroller is that there is no operating system to get in the way of things, so you can get precise control over the signals coming from its pins. This is important for things like audio generation and motor/servo control.

      The Raspberry Pi Pico can be programmed using either MicroPython or C, which are both programming languages. (A programming language is a way of giving instructions to a computer or computing device – Part 4 introduces you to some programming languages). MicroPython is a version of Python optimized for running on microcontrollers. There are a few differences in some instructions, but MicroPython mostly looks the same as Python. You can program a Pico using Thonny, a Python programming tool available in Raspberry Pi OS. You get the option of saving your code into the Pico’s memory or your computer. Any code saved into a file called main.py will run automatically when power is applied to the Pico, independently of whether you have a computer attached.

      Programming a Pico in C, however, is not for the fainthearted. It requires a long process to prepare the C code for compiling or the use of a complex piece of software. We expect it to get easier, but at the moment we would recommend MicroPython instead.

      The Raspberry Pi Pico is extremely cheap: It costs just $4, and it doesn't need an additional microSD card for storage.

      The Raspberry Pi is a fully featured computer, and you can do almost anything with it that you can do with a desktop computer.

      Instead of running Windows or macOS, the Raspberry Pi uses an operating system called Linux. It’s a leading example of open source, a completely different philosophy to the commercial software industry. Rather than being created within the heavily guarded walls of a company, with its design treated as a trade secret, Linux is built by companies and expert volunteers working together. Anyone is free to inspect and modify the source code (a bit like the recipe) that makes it work. You don’t have to pay to use Linux, and you’re allowed to share it with other people, too.

      You probably won’t be able to run the software you have on your other computers on your Raspberry Pi. It won’t run Windows or Mac software, and not all Linux software works on the Raspberry Pi. But a lot of Linux software that is compatible with the Raspberry Pi is available and is free of charge.

      The Raspberry Pi has a graphical windows desktop to start and manage programs (see Chapter 4) as well as a shell for accepting text commands (see Chapter 5). You can use it for browsing the Internet (see Chapter 4), for word processing and spreadsheets (see Chapter 6), or for editing photos (see Chapter 7). You can use it for playing back music or video (see Chapter 8) or for playing games (see Chapter 19). You can use the built-in software to write your own music, too (see Chapter 14). It’s the perfect tool for homework, but it’s also a useful computer for writing letters, managing your accounts, and paying bills online.

      The Raspberry Pi is at its best, however, when it’s being used to learn how computers work, and how you can create your own programs or electronics projects using them. It comes with Scratch (see Chapter 9), a visual programming language that enables people of all ages to create their own animations and games while learning some of the core concepts of computer programming along the way.

      It also comes with Python (see Chapter 11), a professional programming language used by YouTube, Google, and Industrial Light & Magic (the special effects gurus for the Star Wars films), among many others.

      It has GPIO pins on it that you can use to connect up your own circuits to the Raspberry Pi, so you can use your Raspberry Pi to control other devices and to receive and interpret signals from them. In Part 5, we show you how to build some electronic projects controlled by the Raspberry Pi. In Chapter 21, we show you some add-ons you can connect to the GPIO pins.

      One of the great things about the Raspberry Pi is that it’s established a community of businesses that have created products for it, or have shared in its success by selling it. You can now buy the Raspberry Pi from a wide range of electronics companies for hobbyists. Global retailers include Pimoroni (www.pimoroni.com), The Pi Hut (https://thepihut.com), and Adafruit (www.adafruit.com). It’s also available from the Raspberry Pi’s distributors, RS Components (www.rs-components.com) and Element14 (www.element14.com).

      You might also be able to buy it from your local computer

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