/*************************************************************************** * This sample program will sequentially turn on all bits then sequentially * turn them off. This demonstrates how to write to the card. ***************************************************************************/ #include #include #include unsigned int BASE = 0x350; unsigned AskForBaseAddress(unsigned int OldOne) { char msg[7]; int NewOne = 0, Success = 0, Dummy; int AddrInputPosX, AddrInputPosY; puts("\nPlease enter the Base Address for your card (in hex)"); printf("or press ENTER for %X.\n>", OldOne); AddrInputPosX = wherex(); AddrInputPosY = wherey(); do { gotoxy(AddrInputPosX, AddrInputPosY); clreol(); msg[0] = 5; msg[1] = 0; cgets(msg); sscanf(msg + 2, "%x", &NewOne); Success = 1; Dummy = NewOne; if (msg[1] == 0) { gotoxy(AddrInputPosX, AddrInputPosY); printf("%X", OldOne); Success = 1; Dummy = OldOne; } } while(!Success); return (Dummy); } /* end of AskForBaseAddress */ void main() { char ch; unsigned char i; int current; char *msg; clrscr(); gotoxy(12,1); cputs( " A C C E S IDO-XX C A R D S A M P L E P R O G R A M"); gotoxy(10,3); cputs( " PRESS ANY KEY TO CONTINUE."); if( !getch()) getch(); BASE = AskForBaseAddress(BASE); gotoxy(12,1); cputs(" A C C E S IDO-XX C A R D S A M P L E P R O G R A M "); gotoxy(27,8); cputs(" PORT 0 1 AND 2 OUTPUT"); gotoxy(27,9); cputs(" ---------------------"); gotoxy(24,19); cputs(" PRESS ANY KEY TO EXIT PROGRAM "); current = 0xfffe; i=0; while( !kbhit()) { gotoxy(36,11); cprintf( "%X", current); outpw( BASE, current); delay(0); outpw( BASE+2, current); delay(0); outpw( BASE+4, current); delay(0); current = ~(1<