All pastes #470506 Raw Edit

Something

public c v1 · immutable
·published 2007-05-04 10:00 UTC
rendered paste body
#include <stdio.h>#include <errno.h>#include <limits.h>#include <ctype.h>#include <unistd.h>#include <fcntl.h>#include <sys/stat.h>#define SENSOR "/dev/usb/hiddev1"#define BLOCKSIZE 2int main(int argc, char** argv) {		int infd, bytes_read;	char buffer[BLOCKSIZE+1];	infd = open(SENSOR, O_RDONLY);  	bytes_read = read(infd, buffer, BLOCKSIZE);	close(infd);	printf("Temperature: '%c-%c'\n", buffer[0], buffer[1]);}