[fpc-pascal]Using /dev/ttyS1

Thilo Berger thilob at gmx.net
Sat Aug 25 19:13:08 CEST 2001


Mauricio Stefani wrote:

> I'm working with the same thing. A problem I got while writing this kind of code
> was about permissions... Se if your user has permissiom to write the device...

No, that's ok.

> by the way, wich uC are you using? In ineltec, we work with at89c55 ... maybe we
> could exchange some ideas (is that right? sorry but... english is not my primary
> language, heheh)

I'll work with an AT89C52 to connect the I2C-Bus with my PC and give a litte
intelligence to the bus.
The Pascal-Code should fetch some characters eg. values from the uC and should store
it in a
MySQL-Database. So I have something like a little weather-station and could
visualize it on the PC.

But I don't feel familiar with Pascal, because I still have a problem with the Code
Stefan sent:


--- snip ---
If FD_ISSET(FD,FDS) then         {Have we data waiting in UART ? }
 Begin
         InLen := fdRead(FD,InStr[1],80);
         If InLen > 0 then
         For Loop := 1 to Inlen do
 Write(InStr[Loop]);
 End;
--- snip ---

Well, the Procedure looks if there is something in the UART and fetches it, writes
it on the screen.
But how can I create a single string of that?
With something like    "DA1=128<CR>" I can work, but on the stream from the uC I
can't find
neither Chr(10) nor (13), but on the screen there still is a linebreak on the
correct way .....

Any hints?


Thilo
Wermelskirchen, Germany.

--
Linux is like a wigwam:
No windows, no gates, Apache inside :-)






More information about the fpc-pascal mailing list