停止


让动作中的步进电机停止的命令是stop

"stop [decel]"

decel decel指减速。 decel 被省略时使用当前设定的减速值。

<?php
include_once "/lib/sd_spc.php";

spc_reset();
spc_sync_baud(115200);

$sid = 1;
spc_request_dev($sid, "set mode 4");
spc_request_dev($sid, "set vref stop 2");
spc_request_dev($sid, "set vref drive 8");
spc_request_dev($sid, "set rsnc 120 250");

// without stop command
spc_request_dev($sid, "move +800 200 200 200");
while((int)spc_request_dev($sid, "get state"))
    usleep(1);

sleep(1);

// with stop command
spc_request_dev($sid, "move +800 200 200 200");
sleep(1);
spc_request_dev($sid, "stop 200");

?>