spc_request_dev($sid, $cmd);
命令构造如下。
"set $port output $value"
<?php
include "/lib/sd_spc.php";
spc_reset();
spc_sync_baud();
$sid = 1;
echo "turn all output ports on\r\n";
spc_request_dev($sid, "set 0 output high");
spc_request_dev($sid, "set 1 output high");
spc_request_dev($sid, "set 2 output high");
spc_request_dev($sid, "set 3 output high");
sleep(1);
echo "turn all output ports off\r\n";
spc_request_dev($sid, "set 0 output low");
spc_request_dev($sid, "set 1 output low");
spc_request_dev($sid, "set 2 output low");
spc_request_dev($sid, "set 3 output low");
?>
turn all output ports on
turn all output ports off