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();