/* file name: do4o.c, 4 DO outputs test */ /* ex. of 1.8.3 Digital output: 4 digital output (iView ver1.0) */ #include "iview.h" #define DO1 0x100 #define SCAN1 0x101 #define SCAN2 0X102 #define LED 0x103 #define DIN 0x104 #define DOUT 0x105 #define outp outputb void main() { int i=1, quit=0; char c; Print("IVIEW-100: 4DO outputs test.\n\r"); while(!quit) { outp(DOUT,0x01); //DO1 ACTIVE Print("DO 1 high \n\r"); Getch(); outp(DOUT,0x02); //DO1 ACTIVE Print("DO 2 high \n\r"); Getch(); outp(DOUT,0x04); //DO1 ACTIVE Print("DO 3 high \n\r"); Getch(); outp(DOUT,0x08); //DO1 ACTIVE Print("DO 4 high \n\r >q to quit\n\r"); c=Getch(); if( c=='q') quit=1; } }