 //#define LED_D0       15
 
 //fudged for 1 bit reader (bit 7 only)
-#define ALL_PAPER  0x80 // high for paper
-#define ALL_HOLES  0x00 // low for hole
-
-#define REG_PAPER 1 // high for paper 
-#define REG_HOLE  0 // low for hole
+#define ALL_PAPER  (PAPER*0xFF)
+#define ALL_HOLES  (HOLE *0xFF)
+
+#define REG_PAPER PAPER 
+#define REG_HOLE  HOLE
 
 // Set to 8, will only read IN phase
 // Set to 16, will read and collect OUT phase also

          seenReg = true;
        }
        // keep collecting sticky bits until all go zero again
        sticky |= now;
        if ((freg == REG_PAPER) && (now == ALL_PAPER))
        {
          state = STATE_GAP;
          //Serial.println(state);
        }  
      }
    break;

// based on ReadSensors.ino  20/06/2015  D.J.Whale
// (c) 2015, 2016 D.J.Whale

//Turn this on to turn a state change report every state change
//#define CFGEN_SEND_STATE_REPORTS

