LPT programming example in C for ubuntu linux
March 1st, 2009 by admin
I wanted to try out LPT printer port programming for upcoming other project. After hours of learning and searching, I came up with this piece of code.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/io.h>
#include <sys/types.h>
#include <fcntl.h>
#define BASEPORT 0×378 /* lp1 */
int main()
{
char c;
int n, tem;
printf(”Hit enter to stop\n”);
if (ioperm(BASEPORT, [...]