Skip to content

Commit

Permalink
gpio stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastien Bron authored and Bastien Bron committed Sep 19, 2023
1 parent cd08e5b commit 9f5fc7e
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions borne/gpio.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,25 @@
use PiPHP\GPIO\GPIO;
use PiPHP\GPIO\Pin\PinInterface;

// Create a GPIO object
$gpio = new GPIO();

// Retrieve pin 17 and configure it as an output pin
$pin = $gpio->getOutputPin(17);

function ledsON(){

// Create a GPIO object
$gpio = new GPIO();

// Retrieve pin 17 and configure it as an output pin
$pin = $gpio->getOutputPin(17);
// Set the value of the pin high (turn it on)
$pin->setValue(PinInterface::VALUE_HIGH);
}

function ledsOFF(){

// Create a GPIO object
$gpio = new GPIO();

// Retrieve pin 17 and configure it as an output pin
$pin = $gpio->getOutputPin(17);
// Set the value of the pin high (turn it on)
$pin->setValue(PinInterface::VALUE_LOW);
}

0 comments on commit 9f5fc7e

Please sign in to comment.