#use eziopk25.lib

#define NUMINPUT 16

void main() {
  char inState[NUMINPUT];
  int i;

  memset(inState,0,sizeof(inState));
  while (1) {
    for (i = 0; i < NUMINPUT; ++i) {
      hitwd();
      if (eioBrdDI(i) != inState[i]) {
        inState[i] = !inState[i];
        printf("new state for channel %d is %d\n",i,inState[i]);
      }
    }
  }
}