spc_request($sid, 4, $cmd);
Структура командной строки выглядит следующим образом:
"set $port output $value"
<?php
include "/lib/sd_spc.php";
spc_reset();
spc_sync_baud(115200);
$sid = 1;
echo "turn all output ports on\r\n";
spc_request($sid, 4, "set 0 output high");
spc_request($sid, 4, "set 1 output high");
spc_request($sid, 4, "set 2 output high");
spc_request($sid, 4, "set 3 output high");
sleep(1);
echo "turn all output ports off\r\n";
spc_request($sid, 4, "set 0 output low");
spc_request($sid, 4, "set 1 output low");
spc_request($sid, 4, "set 2 output low");
spc_request($sid, 4, "set 3 output low");
?>