DIGITAL INPUT/OUTPUT CARD IOD-144 USER MANUAL
6-10
if((tempB>> i) & ON){
*ary++=ON; }
else
*ary++=OFF;}
}
} /*procedure read_sensors*/
get_status(){
int temp;
temp=inportb(BASEADDR+2); /*this sets status to the lower half of Port C, the*/
/*of Port C, half defined in Initialize to be input, */
/*for four arming switches*/
return temp & 0x0F;
} /*function get_arming_status*/
ALARM(){
long int temp=0;
sound(2000); /*this starts the computer's speaker*/
outportb(BASEADDR+@,0xF0); /*this sets Port C upper nybble bitsto ON*/
/*(1111 binary = F hex).*/
do{
arming_stations=get_status(); /*this activates 4 alarm outputs and then toggles*/
if(arming_stations !=old_arming_stations) /*Port C Hi LSB which might be used*/
temp=2000000000; /*dis-armed*/ /*with an external speaker*/
outportb(BASEADDR+2,inportb(BASEADDR+2)^0x10);
}while(temp++ !=2000000000);
nosound();
} /*procedure ALARM*/
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=
main()
{
time_t start;
initialize();
clscr();
goto(5,5);
printf("This IOD-card demonstration program simulates an alarm\n");
printf("system program for 16 sensors, four arming stations and\n");
printf("four separate alarm outputs which could be routed to a\n");
printf("siren, lights, silent alarm, etc.\n");
printf("\n");
printf("THIS PROGRAM IS FOR DEMONSTRATION PURPOSES ONLY, AND
IS\n");