Raspberry Pi A User Manual page 263

Hide thumbs Also See for Raspberry Pi A:
Table of Contents

Advertisement

C H A P T E R 1 5
Although this brings the script to a close, the loop used is known as an infinite loop: the
instruction
while true
becomes false, or 1 becomes 0. Because this can never happen, the script runs forever—
taking an image every 30 seconds.
Save the file by pressing Ctrl + O, and then change the file's permissions to make it executable
with the following command:
chmod +x timelapse.sh
For more information on file permissions, see Chapter 3, "Linux System Administration".
Finally, run the script with the following command:
./timelapse.sh
The script will immediately take a picture and print the status message "Image captured" to
the console (see Figure 15-10). After 30 seconds, it will take another picture; after another
30 seconds, a third. This will continue forever, or until your SD card is filled with images. To
exit the script, press Ctrl + C.
T H E R A S P B E R R Y P I C A M E R A M O D U L E
at the start tells the script to run through the loop until true
247
Figure 15-9:
The complete
timelapse.
sh script, in the
nano text
editor

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Raspberry Pi A and is the answer not in the manual?

Questions and answers

Related Products for Raspberry Pi Raspberry Pi A

This manual is also suitable for:

Raspberry pi b

Table of Contents