PHP code example of danjohnson95 / pinout

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

    

danjohnson95 / pinout example snippets


'providers' => [
    // ...
    DanJohnson95\Pinout\ServiceProvider::class,
    // ...
],

$pin = \DanJohnson95\Pinout\Facades\PinService::pin(13);

$pin->isOn(); // Whether the pin is "on" (high)
$pin->isOff(); // Whether the pin is "off" (low)
$pin->turnOn(); // Set the pin to "on"
$pin->turnOff(); // Set the pin to "off"
$pin->makeInput(); // Set the pin to input mode
$pin->makeOutput(); // Set the pin to output mode

$pins = \DanJohnson95\Pinout\Facades\PinService::pins(13, 19, 26);

$pins->turnOn(); // Turns all pins on in the collection
$pins->turnOff(); // Turns all pins off in the collection
$pins->makeInput(); // Sets all pins to input mode
$pins->makeOutput(); // Sets all pins to output mode
$pins->findByPinNumber(13); // Returns the Pin instance for the given pin number
$pins->whereIsOn(); // Returns a collection of pins that are on
$pins->whereIsOff(); // Returns a collection of pins that are off
bash
php artisan pinout:get 13
bash
php artisan pinout:on 13
bash
php artisan pinout:off 13