|
Posted by adlerweb on 07/09/07 15:37
Hi
If your scale uses the same settings as your OS (speed, etc) it should
be enough to fopen /dev/ttyS0 and use it like a file. Note: You can not
read and write with one socket - in this case you have to use two.
Example:
$string = "foobar\n";
$pointer = fopen("/dev/ttyS0","w");
fwrite ($pointer, $string);
fclose($pointer);
Florian
pnberry@gmail.com schrieb:
> Newbie here,
>
> I've got a digital scale attached to the first serial port of my Linux
> OS computer: /dev/ttyS0
> How would I set up the serial port for reading data and then how would
> I turn that data into a variable that I could use in a PHP program?
>
> Thanks for any help,
> Paul
>
Navigation:
[Reply to this message]
|