PHP code example of devgiants / shutter

1. Go to this page and download the library: Download devgiants/shutter 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/ */

    

devgiants / shutter example snippets


use Devgiants\MosquittoClientsReactWrapper\Client\MosquittoClientsReactWrapper;
use Devgiants\FilesystemGPIO\Model\Board\Board;
use Devgiants\FilesystemGPIO\Model\GPIO\Logic;
use Devgiants\Shutter\Shutter;

O( 203, Logic::ACTIVE_LOW );
	$gpo1Close = $board->registerGPO( 198, Logic::ACTIVE_LOW );
	$gpi1Open  = $board->registerGPI( 200, Logic::ACTIVE_LOW );
	$gpi1Close = $board->registerGPI( 199, Logic::ACTIVE_LOW );



	$shutter1 = Shutter::create(
		$gpi1Open,
		$gpi1Close,
		$gpo1Open,
		$gpo1Close,
		COMPLETE_SHUTTER_MOVEMENT_DURATION,
		$board->getLoop(),
		$mqttClient,
		'actuator/parent_room/shutter/1'
	);
} catch ( \Exception $exception ) {
	echo "{$exception->getCode()} - {$exception->getMessage()}";
}