bugfixes to gpiopin
This commit is contained in:
parent
acc695b8ad
commit
0fab790ac2
@ -59,7 +59,7 @@ class GpioPin
|
|||||||
throw new \Exception;
|
throw new \Exception;
|
||||||
}
|
}
|
||||||
$this->direction = $direction;
|
$this->direction = $direction;
|
||||||
file_put_contents("/sys/class/gpio/{$this->pin}/direction", $direction);
|
file_put_contents("/sys/class/gpio/gpio{$this->pin}/direction", $direction);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ class GpioPin
|
|||||||
public function setValue($value)
|
public function setValue($value)
|
||||||
{
|
{
|
||||||
$this->value = (bool)$value;
|
$this->value = (bool)$value;
|
||||||
file_put_contents("/sys/class/gpio/{$this->pin}/value", (int)$this->value);
|
file_put_contents("/sys/class/gpio/gpio{$this->pin}/value", (int)$this->value);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ class GpioPin
|
|||||||
throw new \Exception;
|
throw new \Exception;
|
||||||
}
|
}
|
||||||
$this->edge = $edge;
|
$this->edge = $edge;
|
||||||
file_put_contents("/sys/class/gpio/{$this->pin}/edge", $edge);
|
file_put_contents("/sys/class/gpio/gpio{$this->pin}/edge", $edge);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user