Browse Source

Merge pull request #600 from xoan/Encoder_Pulses_Per_Step

add ENCODER_PULSES_PER_STEP
ErikZalm 11 years ago
parent
commit
6a1e980c6d
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      Marlin/ultralcd.cpp

+ 3
- 2
Marlin/ultralcd.cpp View File

88
 
88
 
89
 #if !defined(LCD_I2C_VIKI)
89
 #if !defined(LCD_I2C_VIKI)
90
   #define ENCODER_STEPS_PER_MENU_ITEM 5
90
   #define ENCODER_STEPS_PER_MENU_ITEM 5
91
+  #define ENCODER_PULSES_PER_STEP 1
91
 #else
92
 #else
92
   #define ENCODER_STEPS_PER_MENU_ITEM 2 // VIKI LCD rotary encoder uses a different number of steps per rotation
93
   #define ENCODER_STEPS_PER_MENU_ITEM 2 // VIKI LCD rotary encoder uses a different number of steps per rotation
93
 #endif
94
 #endif
984
         		reprapworld_keypad_move_home();
985
         		reprapworld_keypad_move_home();
985
         	}
986
         	}
986
 		#endif
987
 		#endif
987
-        if (encoderDiff)
988
+        if (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP)
988
         {
989
         {
989
             lcdDrawUpdate = 1;
990
             lcdDrawUpdate = 1;
990
-            encoderPosition += encoderDiff;
991
+            encoderPosition += encoderDiff / ENCODER_PULSES_PER_STEP;
991
             encoderDiff = 0;
992
             encoderDiff = 0;
992
             timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
993
             timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
993
         }
994
         }

Loading…
Cancel
Save