处理一个简单的项目,我可以在浏览器的地址栏中输入192.168.x.xx/?$n
,然后Raspberry Pi将发送一个等效于变量$n
的pwm信号(使用WiringPi库) LED。我刚刚开始使用PHP,这就是为什么我需要帮助。现在我想到的是:使用PHP获取用户输入
<?php
exec("gpio mode 1 pwm");
//declare $n as a variable (integer maybe)
//$n = the user input value from browser (I only know $_GET, pretty sure it's not this right?)
exec("gpio pwm 1 "+$n);
?>
将感谢任何帮助和指针。
http://www.w3schools.com/php/php_forms.asp – zwcloud