DIGITAL INPUT/OUTPUT CARD IOD-144 USER MANUAL
6-11
printf("NOT MEANT TO BE USED AS AN ACTUAL ALARM SYSTEM.\n");
printf("\n");printf("n");
printf("Press any key to begin program.\n");
key=getch();
old_arming_stations=get_status();
do{
clrscr();
read_sensors(sensors_now);
for(i=0;i<=15;i++){
if (!sensors_now[i]) printf("Sensor #%d %s\n,i,"is open");
}
printf("\n");
printf("Press ESC to re-scan, RETURN to begin alarm scanning.");
key=getch();
}while(key!=13);
clrscr();
for(;;){ /*this creates an infinite loop*/
printf("Waiting to be armed. Press any key to halt program.\n");
do{
arming_stations=get_status();
if(kbhit()) abort(0);
}while(arming_stations== old_arming_stations);
sound(1000);
delay(300);
nosound();
printf("Alarm system will activate in 15 seconds");
read_sensors(sensors_at_arm);
old_arming_stations=get_status();
start=time(NULL);
do{
}while(difftime(time(NULL),start) !=15);
printf("\n");
printf("ALARM SYSTEM ACTIVE AND ARMED\n\n");
sound(900);
delay(300);
nosound();
j=0;
do{
read_sensors(sensors_now);
for(i=1;i<=16;i++){
if(sensors_now[i-1] !=sensors_at_arm[i-1])
j=i;
} /*for*/
arming_stations = get_status();
if (arming_stations != old_arming_stations)