How to connect RaspberryPI camera

Needed 
1 RaspberryPI
1 Raspberry PI Camera
recommend install Raspbian
 
 
 
ENABLING THE CAMERA
 
Open the raspi-config tool from the Terminal:
 
Interminal :
sudo raspi-config
 
Select Enable camera and hit Enter, then go to Finish and you'll be prompted to reboot.
 
 
 
 
BASIC USAGE OF RASPISTILL
 
With the camera module connected and enabled, enter the following command in the Terminal to take a picture:
 
 
raspistill -o cam.jpg
 
 
 
In this example the camera has been positioned upside-down. If the camera is placed in this position, the image must be flipped to appear the right way up.
 
VERTICAL FLIP & HORIZONTAL FLIP
 
With the camera placed upside-down, the image must be rotated 180° to be displayed correctly. The way to correct for this is to apply both a vertical and a horizontal flip by passing in the -vf and -hf flags:
 
 
raspistill -vf -hf -o cam2.jpg
 
Vertical and horizontal flipped photo
 
Now the photo has been captured correctly.
 
RESOLUTION
 
The camera module takes pictures at a resolution of 2592 x 1944 which is 5,038,848 pixels or 5 megapixels.
 
FILE SIZE
 
A photo taken with the camera module will be around 2.4MB. This is about 425 photos per GB.
 
Taking 1 photo per minute would take up 1GB in about 7 hours. This is a rate of about 144MB per hour or 3.3GB per day.
 
BASH SCRIPT
 
You can create a Bash script which takes a picture with the camera. To create a script, open up your editor of choice and write the following example code:
 
#!/bin/bash
 
DATE=$(date +"%Y-%m-%d_%H%M")
 
raspistill -vf -hf -o /home/pi/camera/$DATE.jpg
 
This script will take a picture and name the file with a timestamp.
 
You'll also need to make sure the path exists by creating the camera folder:
 
mkdir camera
Say we saved it as camera.sh, we would first make the file executable:
 
chmod +x camera.sh
Then run with:
 
./camera.sh
 
MORE OPTIONS
 
For a full list of possible options, run raspistill with no arguments. To scroll, redirect stderr to stdout and pipe the output to less:
 
raspistill 2>&1 | less
 
Use the arrow keys to scroll and type q to exit.

 

Read 2644 times