<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman" size=3>Here is the 
code I used for reading from the serial but it's not working<BR>I also tried it 
without the "do -- while " (only using the read sentence)<BR>but it also didn't 
work . Is there anyone who could help me ?<BR><BR><BR># include 
&lt;stdio.h&gt;<BR># include &lt;unistd.h&gt;<BR># include &lt;fcntl.h&gt;<BR># 
include &lt;sys/ioctl.h&gt;<BR># include &lt;sys/wait.h&gt;<BR># include 
&lt;string.h&gt;<BR># include &lt;termios.h&gt;<BR># include 
&lt;stdlib.h&gt;<BR># include 
&lt;errno.h&gt;<BR>int<BR>main(void)<BR>&nbsp;{<BR>&nbsp;int fd;<BR>&nbsp;int 
n;<BR>&nbsp;char recv_char;<BR>&nbsp;&nbsp;&nbsp;&nbsp; int m;<BR><BR>&nbsp;fd = 
open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY);<BR>&nbsp;if (fd == 
-1)<BR>&nbsp; {<BR>&nbsp; perror("open_port: unable to open /dev/ttyS0 - 
");<BR>&nbsp; }<BR>&nbsp;else<BR>&nbsp; fcntl (fd, F_SETFL, 
FNDELAY);<BR><BR><BR>&nbsp;&nbsp; do<BR>&nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* wait for a char to arrive 
*/<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m=read(fd, &amp;recv_char, 
1);<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; while (m != 
1);<BR>&nbsp;&nbsp;&nbsp; printf ( "%c",recv_char);<BR>&nbsp;&nbsp;&nbsp; return 
(recv_char);<BR>&nbsp;&nbsp;&nbsp; return (fd);<BR>&nbsp;&nbsp;&nbsp; 
}</FONT><BR><BR><BR><BR></FONT></DIV>
<DIV><FONT face='"Verdana", Geneva, MS sans-serif' color=#448593 
size=-2><B>__________________________________________________________________</B><BR><FONT 
face='"Verdana", Geneva, MS sans-serif' color=#448593 size=-1><B>MOHAMED 
RAOUF</B></FONT><BR><B>ICQ#:&nbsp;<FONT color=#4051c8>44365427</FONT></B><BR>
<TABLE border=0>
  <TBODY>
  <TR>
    <TD vAlign=top><FONT face="Verdana,Geneva, MS sans-serif" color=#448593 
      size=-2><B>Current ICQ status:</B>&nbsp;&nbsp;</FONT></TD>
    <TD vAlign=bottom><IMG 
      src="http://web.icq.com/whitepages/online?icq=44365427&amp;img=21"> 
  </TD></TR></TBODY></TABLE><FONT face=Wingdings size=3><B>+</B></FONT> &nbsp;<A 
href="http://wwp.icq.com/44365427"><B>More ways to contact me 
</B></A><BR><B>__________________________________________________________________</B><BR></FONT></DIV></BODY></HTML>