Mail Archives: djgpp/1997/05/25/16:32:39
Guido Gonzato (guido DOT g AT iol DOT it) writes:
> Hello,
>
> I want to rewrite in C a program I wrote in gwbasic for controlling a
> digital oscilloscope.
>
> I need to know how to access the serial port(s). I only have to read a
> stream of bytes from COM1:, filter out the junk, and write the data to a
> file.
If I am not too much mistaken, you ought to be able to do it with
something like this:
FILE *the_oscilliscope;
the_oscilloscope=fopen ("COM1","rb") // Opens the port for reading in binary
...
do {
while eof(the_oscilloscope) {
// no new data, do nothing
}
deal_with_some_data (getc(the_oscilloscope));
} while (!exit_flag);
--
.*. Where feelings are concerned, answers are rarely simple [GeneDeWeese]
-() < When I go to the theater, I always go straight to the "bag and mix"
`*' bulk candy section...because variety is the spice of life... [me]
Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh
- Raw text -