 
 // ENCODER SETUP ---------------------------
 // encoder on 2 and 3   // +5 is brown, ground is blue
-#define ENCODER_PORT PORTD
+#define ENCODER_PORT PIND
 const int encoder0PinA = 2;  // white   PORTD BIT 2
 const byte encoder0PinAMask = 0x04;
 const int encoder0PinB = 3;  // black   PORTD BIT 3

float homingSpeed = 3.0;
bool homed = false;

const int BACKOFF_STEPS = 600; // how many encoder steps to reverse out of endstop (so Zero is this far from the switch)


// MOTOR TIMING/POS

    then you're going anti-clockwise.
  */
  if (ENCODER_PORT & encoder0PinBMask) {
    encoder0Pos --;
  }
  else {
    encoder0Pos ++;
  }
}

