PHP code example of cvuorinen / raspicam-php

1. Go to this page and download the library: Download cvuorinen/raspicam-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cvuorinen / raspicam-php example snippets




use Cvuorinen\Raspicam\Raspistill;

$camera = new Raspistill();

$camera->takePicture('pic.jpg');

use Cvuorinen\Raspicam\Raspistill;

$camera = new Raspistill();
$camera->timeout(1)
    ->rotate(90)
    ->exposure(Raspistill::EXPOSURE_NIGHT)
    ->quality(85);

$camera->takePicture('pic.jpg');

use Cvuorinen\Raspicam\Raspistill;

$camera = new Raspistill([
    'timeout' => 1,
    'rotate' => 90,
    'exposure' => Raspistill::EXPOSURE_NIGHT,
    'quality' => 85,
]);

$camera->takePicture('pic.jpg');

use Cvuorinen\Raspicam\Raspistill;

$camera = new Raspistill();

// take picture every ten seconds for two minutes
$camera->startTimelapse('image%04d.jpg', 10, 120);
bash
composer