We will turn our attention to the Python libraries or packages that come pre-installed with Raspbian. To view these packages from Thonny, click on Tools
| Manage Packages
. After a short delay, you should see many packages listed in the dialog:
Let's explore a few of these packages.
The camera port, or CSI, on the Raspberry Pi allows you to connect the specially designed Raspberry Pi camera module to your Pi. This camera can take both photos and videos, and has functionality to do time-lapse photography and slow-motion video recording. The picamera
package gives us access to the camera through Python. The following is a picture of a Raspberry Pi camera module connected to a Raspberry Pi 3 Model B through the camera port:
Connect your Raspberry Pi camera module to your Pi, open up Thonny, and type in the following code:
import picamera import time picam = picamera.PiCamera() picam.start_preview() time.sleep(10) picam.stop_preview() picam.close()
This...