
patelv98 - 2012-11-03 15:40:37
hello i have tried the below code
but i am getting nothing neither error nor output please help me get out of this...
<?php
include "php_serial.class.php";
// Let's start the class
$serial = new phpSerial;
// First we must specify the device. This works on both linux and windows (if
// your linux serial device is /dev/ttyS0 for COM1, etc)
$serial->deviceSet("/dev/ttyS0");
// Then we need to open it
// If you want to change the configuration, the device must be closed
//$serial->deviceClose();
// We can change the baud rate
$serial->confBaudRate(9600);
$serial->confParity("none");
$serial->confCharacterLength(8);
$serial->confStopBits(1);
$serial->confFlowControl("none");
$serial->deviceOpen("r+b");
// To write into
//$serial->sendMessage("Hello !");
// Or to read from
$read = $serial->readPort();
for ($i=0;$i<=10;$i++){
//echo "hello";
echo $read;
}
// etc...
?>