class People{
function __construct()
{

shell_exec(\"大众gpio mode 0 out\"大众);
shell_exec(\"大众gpio mode 1 in\"大众);
}
function start(){
swoole_timer_tick(500,function($timer_id){
$val = shell_exec(\"大众gpio read 1\"大众);
echo $val;
if($val==1){
swoole_timer_clear($timer_id);
shell_exec(\"大众gpio write 0 1\公众);
swoole_timer_after(2500,function(){
$this->start();
});
}else{
shell_exec(\"大众gpio write 0 0\"大众);
}
});
}
}
$Signal = new People();
$Signal->start();