Book Image

Raspberry Pi Projects for Kids

By : Daniel Leonard Bates
Book Image

Raspberry Pi Projects for Kids

By: Daniel Leonard Bates

Overview of this book

Table of Contents (11 chapters)

Using your Raspberry Pi


Now that your Raspberry Pi is up and running, you'll want to know how to keep it working properly and how to customize it to suit your needs.

The command line

Most of the time, it will be possible to do what you want to do using the mouse by clicking on different parts of the screen; however, at some point, you might find the need to use the command line, as shown in the following screenshot:

The command line is a completely text-based way of controlling a computer, and can be used to do just about anything that can be done by clicking and more. It is available on almost all computers, but is usually hidden away. Some computer users prefer using the command line because they can type faster than they can click the mouse!

Here is a very quick overview of some common commands. Open a command line by double-clicking on the LXTerminal icon on the desktop, and try these out. You will need to press Enter to inform the Raspberry Pi that your command has been executed. A longer introduction, including information on how to watch a movie in the command line, can be found online at http://www.techradar.com/news/computing/pc/1161712.

  • ls: This lists directory contents. (Directory is Linux's word for a folder.) This command will list all the files and directories available to you in the current directory.

  • cd <directory name>: This changes the directory and allows you to move into another directory, so you can see its contents in the same way that double-clicking on a directory icon moves you into that directory. You can move through multiple levels of directories in one go by separating the directory names with /, and you can go up to the parent directory (the directory that contains the current directory) using the special .. directory name.

  • man <program name>: This opens the manual and brings up lots of information about a particular program, including what it does and how to use it. It is very useful if you forget how to use something! Try man ls to see some advanced information about the ls command we tried earlier, and press q to quit. You can scroll through the information using the arrow keys or the Space bar.

  • <program name> [extra information]: This starts the program, and optionally passes some extra information to it. Try typing in scratch to start the Scratch program (we'll cover more about this in the next chapter); or, if you are connected to the Internet, navigate to midori www.raspberrypi.org to open the Midori web browser and go straight to the Raspberry Pi home page.

  • Tab: This key automatically completes a word. Even if you have not completely typed in the name of a program or file or folder, try pressing Tab. If there is only one option available that begins with the letters you have typed so far, the whole word will be completed for you. If there are multiple options (or none), nothing will change; you can press Tab again to display a list of possibilities.

Updating and installing new software

The Raspberry Pi is an unusual sort of computer, so if you want to install a program, you either need to download a version that is specifically for the Raspberry Pi, or use Raspbian's package system.

A package is a program or a part of a program, and many versions of Linux (including Raspbian) maintain a list of all compatible packages, making it easy to keep all of your software up to date. You can update to the latest version of this list if you have an Internet connection by typing sudo apt-get update in the command line.

Note

Be very careful when using the sudo command. It forces the Raspberry Pi to do exactly what you tell it to do, without checking to make sure that the command is sensible. The command is useful in situations like this, where we want to make changes to the installed programs, but it also allows you to delete essential files. Double check your spelling before continuing.

You can search for available packages with keywords using the apt-cache search <keywords> command. Try apt-cache search game, for example, to see a list of the free games available. You could even try installing one (XBubble is good, for example). The name of the package is the first word of the line, and you can install a package using sudo apt-get install <package name>.

To update all the installed packages to the latest available version, type sudo apt-get upgrade.

Other uses for Raspberry Pi

Although the Raspberry Pi was designed to get people interested in computing, its cost and power make sure that it is also popular for other reasons. Since the Raspberry Pi is a general-purpose computer, it is capable of everything a traditional computer can do, but perhaps a little slower. There is a web browser (Midori), word processors, and web servers that are available. A common use case is similar to a media center, to watch films and view pictures.

There are many different operating systems included within the NOOBS package. You can see them if you click on Shift when the Raspberry Pi first starts to boot, as shown in the following screenshot:

This will take you back to the list you saw earlier when you started your Raspberry Pi for the first time. Each operating system comes with a short description. There are a couple of different flavors of Linux, the very fast RISC OS, and two different media centers, OpenELEC and Raspbmc.

If you want to try one of these operating systems, make sure you first back up all of your data as it will be erased when the new operating system is installed.

Troubleshooting

One of the main strengths of the Raspberry Pi is its fantastic community. If you ever have any difficulties, consider stopping by the Raspberry Pi forums at http://www.raspberrypi.org/forum/. Your question may have already been asked; if not, there are thousands of enthusiastic Pi owners on hand to help. The following are the most common issues:

  • My Raspberry Pi doesn't boot – only the red power light shows: This suggests that the SD card was not written correctly. Try following the instructions again, and if that fails, try a new SD card.

  • My Raspberry Pi randomly restarts by itself: This is usually because the Pi is not receiving enough power. Double check that your power supply is capable of supplying at least 700 mA (0.7A) at 5V. This should be written somewhere on the supply. Perhaps you can try upgrading to a 1000 mA (1.0A) supply if you continue to have problems. Also, make sure that you do not have particularly power-hungry peripherals plugged into your Raspberry Pi. For example, some Wi-Fi dongles and keyboards with very bright LEDs can cause problems.

  • I can't enter my password in the login screen: Nothing is displayed when the password is entered (not even stars) to minimize the information that others can gain from seeing the screen. It is likely that the keys are still being recognized; try typing in the whole password blindly and pressing Enter.

  • The display does not fill my screen or extends beyond the edges: This is because of overscan settings. Many old televisions had cabinets that overlapped a part of the screen, so images were given black borders to ensure that no part of the picture was lost. Many modern monitors, however, do not have this problem, so the black bars are just a nuisance. First try enabling or disabling the overscan settings by typing sudo raspi-config at a command line and selecting the appropriate option. If this still does not work, search on the Internet for Raspberry Pi overscan troubleshooting for detailed guides.

  • I can't see anything at all on the screen: If the Pi is definitely on and the OK/ACT light is lit or flashing, try pressing 1, 2, 3, or 4 on your keyboard to select different video modes.