From 459a9e4bfc7e8cb7f6a615aed99d2d426c9c01d0 Mon Sep 17 00:00:00 2001 From: sieja Date: Tue, 12 Aug 2025 18:42:43 +0200 Subject: [PATCH] =?UTF-8?q?Doszlifowanie=20zmian=20bieg=C3=B3w=20Kalibracj?= =?UTF-8?q?a=20pod=20nowe=20serwo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ESP_AutomatedGearShifter.ino | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; } }