diff --git a/ESP32/ESP_AutomatedGearShifter/ESP_AutomatedGearShifter.ino b/ESP32/ESP_AutomatedGearShifter/ESP_AutomatedGearShifter.ino index 452ce61..70f1697 100644 --- a/ESP32/ESP_AutomatedGearShifter/ESP_AutomatedGearShifter.ino +++ b/ESP32/ESP_AutomatedGearShifter/ESP_AutomatedGearShifter.ino @@ -5,7 +5,7 @@ #include #include -#define Version "2.2.9" +#define Version "2.2.10" ////2DO: // menu do zmiany zakresu predkosci biegów // menu do zmiany zakresu kątów biegów, obwodu koła, ilosci magnesow @@ -23,7 +23,7 @@ Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); #define PinLED 25 //on board: D25 ORANGE loop signal #define VoltInptPin 27 //on board: D27 #define Btn2 33 //on board: D33 Button2 - +#define ServoShift 4 //ręczna kalibracja biegu // #define VoltInptPin 23 //on board: D23 Battery Voltage prawdopodobnie uszkodzone ADC #define ServoMaxAngle 130 @@ -177,6 +177,7 @@ void setPosition(int currentGear) { } sleepMode = 0; } + pos = pos + ServoShift; //reczna kalibracja myservo.write(pos); } @@ -315,8 +316,10 @@ void calcGear() { currentGear = currentGear; pointerVisibility = 0; } else { + if (currentGear != calculatedGear) { + lastGearCalc = millis(); + } currentGear = calculatedGear; - lastGearCalc = millis(); pointerVisibility = 1; } }