/* * example3.c: display all the "printable" characters on an LED display * */ #include #include #include #define BASEPORT 0x2a2 /* PLC-730 card LED Output */ int main() { int x; /* Define the "printable" Characters */ unsigned char y[] = {0x77,0x7c,0x39,0x5e,0x79,0x71,0x76,0x06,0x1e,0x38,0x3f,0x73,0x6d,0x3e}; /* Get access to the ports */ if (ioperm(BASEPORT, 3, 1)) {perror("ioperm"); exit(1);} for(x=0;x<140;x++) { /* Send out one character at a time */ outb(y[x%14], BASEPORT+1); /* Sleep for a while (1 sec) */ usleep(1000000); /* Blink the LED (turn it off for 2 ms) */ outb(0, BASEPORT+1); usleep(2000); } /* Free the ports - We don't need the ports anymore */ if (ioperm(BASEPORT, 3, 0)) {perror("ioperm"); exit(1);} exit(0); }