FreeBSD - Linux C Based Program to Read a Serial Port
Submitted by parkviewadmin on Wed, 2012-11-21 22:19.
Back in 2007 or so I wrote a C program to read my TP-200 serial port based GPS unit. I was supprised to find that in 2012, the same program would compile on a Raspberry Pi Linux environment! Go POSIX programming.
Attached is the C code file and my Makefile I use to compile it. Use at your own risk. It works for me, but maybe not you? To use it, I just run ./gps > gps_data_file-20121121.txt and a number of lines will be written to the file each second.
Attachment | Size |
---|---|
gps.c | 1.77 KB |
Makefile | 456 bytes |