From ed90d919dee5eda75a46521bb0ea04d500191b13 Mon Sep 17 00:00:00 2001 From: nidayand Date: Wed, 4 Oct 2017 16:35:39 +0200 Subject: [PATCH] Removed trip msgs as that pauses the movement of the blind --- motor_on_a_roller_blind-ws.ino | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/motor_on_a_roller_blind-ws.ino b/motor_on_a_roller_blind-ws.ino index 0663f30..5a34dea 100644 --- a/motor_on_a_roller_blind-ws.ino +++ b/motor_on_a_roller_blind-ws.ino @@ -10,7 +10,7 @@ #include -String version = "1.0"; +String version = "1.1"; //Configure Default Settings String APid = "BlindsConnectAP"; @@ -366,29 +366,12 @@ void loop(void) if (currentPosition > path){ small_stepper.step(-1); currentPosition = currentPosition - 1; - - //Avoid flooding the websocket - if (tripCounter > 40){ - int pos = (currentPosition * 100)/maxPosition; - webSocket.broadcastTXT("{ \"type\":\"position\", \"value\":"+String(pos)+"}"); - tripCounter = 0; - } - tripCounter++; - } else if (currentPosition < path){ small_stepper.step(1); currentPosition = currentPosition + 1; - //Avoid flooding the websocket - if (tripCounter > 40){ - int pos = (currentPosition * 100)/maxPosition; - webSocket.broadcastTXT("{ \"type\":\"position\", \"value\":"+String(pos)+"}"); - tripCounter = 0; - } - tripCounter++; } else { path = 0; action = ""; - tripCounter = 0; int pos = (currentPosition * 100)/maxPosition; webSocket.broadcastTXT("{ \"type\":\"position\", \"value\":"+String(pos)+"}"); Serial.println("Stopped. Reached wanted position");