Updated with latest changes

This commit is contained in:
Gordon Drogon
2012-12-11 20:59:52 +00:00
committed by Philip Howard
parent 2a6da9eefe
commit dda3305ce1
24 changed files with 919 additions and 802 deletions

31
examples/serialRead.c Normal file
View File

@@ -0,0 +1,31 @@
/*
* serialRead.c:
* Example program to read bytes from the Serial line
*
*/
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <wiringSerial.h>
int main ()
{
int fd ;
if ((fd = serialOpen ("/dev/ttyAMA0", 115200)) < 0)
{
fprintf (stderr, "Unable to open serial device: %s\n", strerror (errno)) ;
return 1 ;
}
// Loop, getting and printing characters
for (;;)
{
putchar (serialGetchar (fd)) ;
fflush (stdout) ;
}
}