uio_in()


Reading the designated pin value

Description

int uio_in(int $uio_id, int $pin)

Parameters

Return Value

Returns 1 when the port state is HIGH, 0 when the port state is LOW

Example

<?php
$in_value = 0;
include "/lib/sd_340.php";
uio_setup(0, 0, "in_pu");       // Setting the pin 0 of the UIO 0 to input with pull-up
echo $in_value = uio_in(0, 0);  // Reading and printing the pin 0 of the UIO 0
?>

See also