本文整理汇总了PHP中Pi::getVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP Pi::getVersion方法的具体用法?PHP Pi::getVersion怎么用?PHP Pi::getVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pi
的用法示例。
在下文中一共展示了Pi::getVersion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @link http://www.raspberrypi-spy.co.uk/2012/06/simple-guide-to-the-rpi-gpio-header-and-pins/
*/
public function __construct()
{
$raspi = new Pi();
if ($raspi->getVersion() < 4) {
$this->pins = array(0, 1, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 21, 22, 23, 24, 25);
$this->hackablePins = array(4, 7, 8, 9, 10, 11, 17, 18, 21, 22, 23, 24, 25);
} else {
if ($raspi->getVersion() < 16) {
# new GPIO layout (REV2)
$this->pins = array(2, 3, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 22, 23, 24, 25, 27);
$this->hackablePins = array(4, 7, 8, 9, 10, 11, 17, 18, 22, 23, 24, 25, 27);
} else {
# new GPIO layout (B+)
$this->pins = array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27);
$this->hackablePins = array(4, 5, 6, 12, 13, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27);
}
}
}