<?php
$val= “123468”;
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+’); //you can use this for Linux
fwrite($fp, “\f”);
fwrite($fp,$val); //write string to serial
fclose($fp);
?>
Advertisements