PHP Class PiPHP\GPIO\Pin\Pin

Inheritance: implements PiPHP\GPIO\Pin\PinInterface
Show file Open project: piphp/gpio Class Usage Examples

Protected Properties

Property Type Description
$fileSystem
$number

Public Methods

Method Description
__construct ( PiPHP\GPIO\FileSystem\FileSystemInterface $fileSystem, integer $number ) Constructor.
export ( )
getNumber ( )
getValue ( )
unexport ( )

Protected Methods

Method Description
getPinFile ( string $file ) : string Get the path of a pin access file.
setDirection ( $direction )

Private Methods

Method Description
getFile ( string $file ) : string Get the path of the import or export file.
writePinNumberToFile ( string $file ) Write the pin number to a file.

Method Details

__construct() public method

Constructor.
public __construct ( PiPHP\GPIO\FileSystem\FileSystemInterface $fileSystem, integer $number )
$fileSystem PiPHP\GPIO\FileSystem\FileSystemInterface An object that provides file system access
$number integer The number of the pin

export() public method

public export ( )

getNumber() public method

public getNumber ( )

getPinFile() protected method

Get the path of a pin access file.
protected getPinFile ( string $file ) : string
$file string The type of pin file (edge/value/direction)
return string

getValue() public method

public getValue ( )

setDirection() protected method

protected setDirection ( $direction )

unexport() public method

public unexport ( )

Property Details

$fileSystem protected property

protected $fileSystem

$number protected property

protected $number