[PHP] Serial 통신 - 쓰기[PHP] Serial 통신 - 쓰기

Posted at 2015. 1. 22. 09:15 | Posted in IT/php
홈페이제작업체 NuGuWeb

<?php
exec("mode com4: BAUD=9600 PARITY=n DATA=8 STOP=1 to=off dtr=off rts=off");
$fp =fopen("com4", "w");
//$fp = fopen('/dev/ttyUSB0','r+'); //use this for Linux
fwrite($fp, "string to send"); //write string to serial
fclose($fp);
?>

//