#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>

int main()
{
	int nbytes ;      
	char n[20];
	short a = *((short *)&n[0]);
	short b = *((short *)&n[2]);
	short c = *((short *)&n[4]);

	int     fd = open( "/dev/mytimer", O_RDONLY );
	if ( fd < 0 ) { perror( "/dev/mytimer" ); exit(1); }

	while ( 1 )
	{

		nbytes = read( fd, n, 40);
		if ( nbytes < 0 ) break;

		printf( "\r a = %d \n ", a);
		printf("\r b = %d \n",b);
		printf("\r c = %d \n",c);

		sleep(1);
		fflush( stdout );
	}
	return 0;
}
