#include #include #include #include #include #include #include #define LCD_DEV "/dev/lcd" char * lcd_clear = "\033?25l\033[2J\033H"; int lcd_say (char *str) { int fd; /* open device */ if ((fd=open("/dev/lcd",O_WRONLY)) == -1) { perror("Error opening " LCD_DEV); return 1; } /* cursor off, clear, home */ write(fd, lcd_clear, 11); /* output everything */ write(fd, str, strlen(str)); if (close(fd) == -1) { perror("Error closing " LCD_DEV); return 1; } return 0; }; int main(int argc,char **argv){ if (argc < 2) { fprintf(stderr, "Usage: %s \n", argv[0]); exit(2); } return lcd_say(argv[1]); };