Mine also needs this to set up the pins and interrupts: "#define E1P1 26 #define E1P2 27" ... " pinMode(E1P1, INPUT_PULLUP); pinMode(E1P2, INPUT_PULLUP);" ... " attachInterrupt(digitalPinToInterrupt(E1P1), countE1, CHANGE); attachInterrupt(digitalPinToInterrupt(E1P2), countE1, CHANGE);"