Bird
0
0
Raspberry Piprogramming~10 mins

Raspberry Pi Camera setup - 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 Raspberry Pi camera module library.

Raspberry Pi
from picamera import [1]
Drag options to blanks, or click blank then click option'
ACamera
BPiCamera
CRaspberryCamera
DCameraModule
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect class names like 'Camera' or 'RaspberryCamera'.
Forgetting to import the camera class.
2fill in blank
medium

Complete the code to create a camera object.

Raspberry Pi
camera = [1]()
Drag options to blanks, or click blank then click option'
APiCamera
BRaspberryPiCamera
CCamera
DCameraModule
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to instantiate a class that was not imported.
Using wrong class names.
3fill in blank
hard

Fix the error in the code to capture an image and save it as 'image.jpg'.

Raspberry Pi
camera.capture([1])
Drag options to blanks, or click blank then click option'
A'image.jpg'
B'photo.jpg'
C'picture.bmp'
D'image.png'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong file extensions like '.png' or '.bmp'.
Not using quotes around the filename.
4fill in blank
hard

Fill both blanks to set the camera resolution to 1024x768.

Raspberry Pi
camera.resolution = ([1], [2])
Drag options to blanks, or click blank then click option'
A1024
B768
C640
D480
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping width and height values.
Using incorrect resolution numbers.
5fill in blank
hard

Fill all three blanks to start the camera preview, wait 5 seconds, then stop the preview.

Raspberry Pi
camera.[1]()
time.sleep([2])
camera.[3]()
Drag options to blanks, or click blank then click option'
Astart_preview
B5
Cstop_preview
Dpreview_start
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong method names like 'preview_start'.
Forgetting to import time module for sleep.
Using wrong sleep duration.