KEMBAR78
Raspberry Pi Commands Summary | PDF
0% found this document useful (0 votes)
6 views2 pages

Raspberry Pi Commands Summary

The document provides a list of popular Raspberry Pi commands for capturing images and videos using the Camera Module, as well as GPIO and socket programming commands. It includes examples for initializing the camera, capturing images, recording videos, and setting up GPIO pins. Additionally, it covers basic socket operations for client/server communication.

Uploaded by

abhignabollam16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Raspberry Pi Commands Summary

The document provides a list of popular Raspberry Pi commands for capturing images and videos using the Camera Module, as well as GPIO and socket programming commands. It includes examples for initializing the camera, capturing images, recording videos, and setting up GPIO pins. Additionally, it covers basic socket operations for client/server communication.

Uploaded by

abhignabollam16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Popular Raspberry Pi Commands - Summary

raspistill -o Desktop/image.jpg

-> Captures a still image using the Raspberry Pi Camera Module.

raspistill -o Desktop/image-small.jpg -w 640 -h 480

-> Captures a smaller-sized image by specifying width and height.

raspivid -o Desktop/video.h264

-> Records a video using the Camera Module.

from picamera import PiCamera

-> Imports the PiCamera library in Python.

camera = PiCamera()

-> Initializes the camera object.

camera.start_preview(), camera.stop_preview()

-> Starts and stops the camera preview window.

camera.capture('/home/pi/Desktop/image.jpg')

-> Captures a still image and saves it to Desktop.

camera.rotation = 180

-> Rotates the camera preview/image.

camera.start_recording('video.h264'), camera.stop_recording()

-> Starts and stops video recording using Python.

import RPi.GPIO as GPIO

-> Imports the GPIO library for Raspberry Pi.

GPIO.setmode(GPIO.BCM) or GPIO.setmode(GPIO.BOARD)

-> Sets pin numbering mode (BCM or BOARD).

GPIO.setup(pin, GPIO.OUT or GPIO.IN)

-> Sets a GPIO pin as input or output.


GPIO.output(pin, state)

-> Sets a GPIO pin to HIGH or LOW.

GPIO.input(pin)

-> Reads input value from a GPIO pin.

GPIO.setwarnings(False)

-> Disables GPIO warnings.

socket.socket()

-> Creates a socket for client/server communication.

socket.bind((host, port))

-> Binds server to a host IP and port.

socket.listen(5)

-> Listens for incoming client connections.

socket.connect((host, port))

-> Client connects to the server.

socket.recv(1024), socket.send(data)

-> Receives or sends data over network sockets.

You might also like