The_Official_Raspberry_Pi_-_Beginner’s_Book_Vol1,_2018 (1)

(singke) #1

198 THE OFFICIAL RASPBERRY PI BEGINNER'S GUIDE


Testing the Camera Module
To confirm that your Camera Module is properly installed, and that you’ve enabled the
interface in the Raspberry Pi Configuration Tool, you can use the raspistill tool. This, along with
raspivid for videos, is designed to capture images from the camera using the Raspberry Pi’s
command-line interface (CLI).
Unlike the programs you’ve been using so far, you won’t find raspistill in the menu. Instead,
click on the raspberry icon to load the menu, choose the Accessories category, and click on
Terminal. A black window with green and blue writing in it will appear (Figure 8-4): this is the
terminal, which allows you to access the command-line interface.

5 Figure 8-4: Open a Terminal window to enter commands

To test the camera, type the following into the Terminal:

raspistill -o test.jpg

As soon as you hit ENTER, you’ll see a large picture of what the camera sees appear on-
screen (Figure 8-5). This is called the live preview and, unless you tell raspistill otherwise,
it will last for 5 seconds. After those 5 seconds are up, the camera will capture a single still
picture and save it in your home folder under the name test.jpg. If you want to capture another,
type the same command again – but make sure to change the output file name, after the -o,
or you’ll save over the top of your first picture!
Free download pdf