     // }
     // Wire.endTransmission();
 
-    pos += readEncoderDelta(enc1);
+    // pos += readEncoderDelta(enc1);
+    pos= lme.read();
+
     if(pos != lastpos && millis() > lt1) {
         //Serial.println(pos);
         //lcd_setCursor(0, 1);

        lcd_setCursor(0, 2);
        lcd_printf("%5ld.%04ld mm", p/1000, abs(p%1000));
        lastpos = pos;
        lt1 = millis() + 1000;
    }

    if(millis() > lt2) {
        // read buttons
        uint8_t b= lcd_readButtons();
        if(b & BUTTON_LEFT) {
            pos= 0;
        }
        lt2= millis() + 200;
    }

    state = enc_states[(old_AB & 0x0f)];
    return state;
}

void setup()
{
