     int previousEncoderState = encoderState;
     encoderState = (encoderState & 0x2) | (digitalRead(PIN_ENCODER_GATE_2) == LOW ? 0x1 : 0);
     updateEncoder(previousEncoderState, encoderState);
-}
-
-void updateEncoder(int previous, int current) {
-    static int grayToBinary[4] = { 0, 1, 3, 2 };
-    previous = grayToBinary[previous & 0x3];
-    current = grayToBinary[current & 0x3];
-
-    if (current == ((previous+1) & 0x3))
-        encoderPosition++;
-    if (current == ((previous-1) & 0x3))
-        encoderPosition--;
 }
 
 void currentMeasurementTick() {

#define PIN_ENCODER_GATE_1 20
#define PIN_ENCODER_GATE_2 21
#define PIN_BATTERY_VOLTAGE A2
#define REFERENCE_VOLTAGE 5.0
#define BATTERY_RESISTOR_DIVISOR 1.0
#define MOTOR_CURRENT_LIMIT_MILLIAMPS 2500
#define MOTOR_CLOSING_CURRENT_LIMIT_MILLIAMPS 1000
#define MOTOR_POLARITY 1    // Change to -1 to invert movement direction

#include "Version.h"

#define BOARD_NAME "KOMAROOF"
#define PIN_UNUSED 46
#define PIN_ONE_WIRE_BUS 44
#define PIN_BUTTON_CLOSE 42
#define PIN_BUTTON_OPEN 40
