Bird
0
0
Raspberry Piprogramming~10 mins

Time-lapse photography in Raspberry Pi - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the library needed to control the Raspberry Pi camera.

Raspberry Pi
import [1]
Drag options to blanks, or click blank then click option'
Aos
Btime
Csys
Dpicamera
Attempts:
3 left
💡 Hint
Common Mistakes
Importing the wrong library like 'time' or 'os' instead of 'picamera'.
2fill in blank
medium

Complete the code to pause the program for 5 seconds between shots.

Raspberry Pi
time.[1](5)
Drag options to blanks, or click blank then click option'
Asleep
Bwait
Cpause
Ddelay
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'wait' or 'pause' which are not valid functions in the time module.
3fill in blank
hard

Fix the error in the code to capture an image with the camera.

Raspberry Pi
camera.capture('[1]')
Drag options to blanks, or click blank then click option'
Acamera.jpg
Bcapture()
Cimage.jpg
Dpic.jpg()
Attempts:
3 left
💡 Hint
Common Mistakes
Adding parentheses to the filename or using invalid filenames.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that stores image filenames with their capture order.

Raspberry Pi
images = {f'image[1].jpg': [2] for i in range(1, 6)}
Drag options to blanks, or click blank then click option'
Ai
Ci+1
Di*2
Attempts:
3 left
💡 Hint
Common Mistakes
Using expressions like 'i+1' or 'i*2' which do not match the numbering.
5fill in blank
hard

Fill all three blanks to create a loop that captures 3 images with a 2-second delay between each.

Raspberry Pi
for [1] in range(1, 4):
    camera.capture(f'image[2].jpg')
    time.[3](2)
Drag options to blanks, or click blank then click option'
Ai
Csleep
Dwait
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'wait' instead of 'sleep' or wrong variable names.