[SOLVED] Slider sending value (on release) 2 times

Hello,

I’m trying to read slider value on serial monitor when slider position is changed (widget is configured to send value on release). For some reason, I’m getting duplicated entries. I tried also other option (to send value constantnly, and in that case there are no duplicated values during sliding, but when I release last value is also duplicated. :slight_smile:

Slider is configured as virtual port V0. My code:

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "xxx";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "xxx";
char pass[] = "xxx";

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
}

BLYNK_WRITE(V0)
{
  int pinValue = param.asInt(); // assigning incoming value from pin V0 to a variable
  Serial.print("V0 Slider value is: ");
  Serial.println(pinValue);
  
}


void loop()
{
  Blynk.run();
}

Reading from serial monitor when I change slider position few times:

[16502] Connecting to AndroidAP
[34698] Connected to WiFi
[34698] IP: 192.168.43.228
[34698] Blynk v0.3.9 on ESP-12
[34698] Connecting to blynk-cloud.com:8442
[34878] Ready (ping: 6ms).
V0 Slider value is: 382
V0 Slider value is: 382
V0 Slider value is: 669
V0 Slider value is: 669
V0 Slider value is: 287
V0 Slider value is: 287
V0 Slider value is: 671
V0 Slider value is: 671
V0 Slider value is: 203
V0 Slider value is: 203
V0 Slider value is: 803
V0 Slider value is: 803
V0 Slider value is: 532
V0 Slider value is: 532

I’m experimenting right now, but I’m planing to triger some functions which would have slider value as parameter, but I don’t want to execute function 2 times. Am I doing something wrong? Thanks in advance.

I have also seen this behavior in my code for my cloud lamp posted on here. It’s not a concern for that project, but I could see how it could affect other projects. I just wanted to say you aren’t the only one that has seen this occur.

Yep, such issue is possible, we’ll fix it till the next release

yeah - happening for me too :slight_smile:

just means double the amount of serial prints and function executions for me, and occasional flooding, but i get around this…

be v.nice to have a fix though :smiley:

ps - see why i get flooding with my slider:

{
  modeSelect = param.asInt(); // manual mode ON
  if (modeSelect == 1)
  {
#ifdef debug
    Serial.println(F("############# - System = modeSelect slider set to '1' = 'MANUAL'"));
    Serial.println(F("------------"));
#endif
    digitalWrite(livingVent, LOW);
    digitalWrite(bedroomsVent, LOW);
    digitalWrite(roofVent, LOW);
    digitalWrite(houseVent, LOW);
    digitalWrite(externVent, LOW);
    digitalWrite(upstairsFan, HIGH); //high is OFF for the fan
    Blynk.virtualWrite(8, 0); // BED LED on Blynk app
    Blynk.virtualWrite(10, 0); // LVR LED on Blynk app
    Blynk.virtualWrite(5, 0); //rof LED on Blynk app
    Blynk.virtualWrite(4, 0); //hse LED on Blynk app
    Blynk.virtualWrite(6, 0); //ext LED on Blynk app
    Blynk.virtualWrite(27, 1023); //nil LED on Blynk app
    Blynk.virtualWrite(28, 0); //fan LED on Blynk app
    Blynk.virtualWrite(0, 0); // ERR LED on Blynk app
    Blynk.virtualWrite(20, 0); //living error on Blynk app
    Blynk.virtualWrite(21, 0); //beds error on Blynk app
    Blynk.virtualWrite(41, 0); //Bedrooms outlet button LED on Blynk app
    Blynk.virtualWrite(91, 0); //living outlet button LED on Blynk app
    fanCheck();
#ifdef debug
    Serial.println(F("System = modeSelect MANUAL mode, everything off, select inlet/outlet/fan!"));
    Serial.println(F("------------"));
#endif
  }
  else if (modeSelect == 2)
  {
#ifdef debug
    Serial.println(F("############# - System = modeSelect set to 'AUTO'"));
    Serial.println(F("------------"));
#endif
    digitalWrite(livingVent, LOW);
    digitalWrite(bedroomsVent, LOW);
    digitalWrite(roofVent, LOW);
    digitalWrite(houseVent, LOW);
    digitalWrite(externVent, LOW);
    digitalWrite(upstairsFan, HIGH); //high is OFF for the fan
    Blynk.virtualWrite(8, 0); // BED LED on Blynk app
    Blynk.virtualWrite(10, 0); // LVR LED on Blynk app
    Blynk.virtualWrite(5, 0); //rof LED on Blynk app
    Blynk.virtualWrite(4, 0); //hse LED on Blynk app
    Blynk.virtualWrite(6, 0); //ext LED on Blynk app
    Blynk.virtualWrite(27, 1023); //nil LED on Blynk app
    Blynk.virtualWrite(28, 0); //fan LED on Blynk app
    Blynk.virtualWrite(0, 0); // ERR LED on Blynk app
    Blynk.virtualWrite(20, 0); //living error on Blynk app
    Blynk.virtualWrite(21, 0); //beds error on Blynk app
    Blynk.virtualWrite(41, 0); //Bedrooms outlet button LED on Blynk app
    Blynk.virtualWrite(91, 0); //living outlet button LED on Blynk app
    dewPointUplift = 0.30;
    fanCheck();
    chooseInlet();
  }
  else if (modeSelect == 3)
  {
#ifdef debug
    Serial.println(F("############# - System = modeSelect set to 'AUTO-DP'")); // this is auto with ignore dew point
    Serial.println(F("------------"));
#endif
    digitalWrite(livingVent, LOW);
    digitalWrite(bedroomsVent, LOW);
    digitalWrite(roofVent, LOW);
    digitalWrite(houseVent, LOW);
    digitalWrite(externVent, LOW);
    digitalWrite(upstairsFan, HIGH); //high is OFF for the fan
    Blynk.virtualWrite(8, 0); // BED LED on Blynk app
    Blynk.virtualWrite(10, 0); // LVR LED on Blynk app
    Blynk.virtualWrite(5, 0); //rof LED on Blynk app
    Blynk.virtualWrite(4, 0); //hse LED on Blynk app
    Blynk.virtualWrite(6, 0); //ext LED on Blynk app
    Blynk.virtualWrite(27, 1023); //nil LED on Blynk app
    Blynk.virtualWrite(28, 0); //fan LED on Blynk app
    Blynk.virtualWrite(0, 0); // ERR LED on Blynk app
    Blynk.virtualWrite(20, 0); //living error on Blynk app
    Blynk.virtualWrite(21, 0); //beds error on Blynk app
    Blynk.virtualWrite(41, 0); //Bedrooms outlet button LED on Blynk app
    Blynk.virtualWrite(91, 0); //living outlet button LED on Blynk app
    dewPointUplift = 1;//this means ignore dew point uplift
    fanCheck();
    chooseInlet();
  }
}

Hi all, please check the latest update on Google Play - it contains a fix to this issue

1 Like

Thanks. Just updated app and problem with duplicated values is fixed now :wink: but I noticed that there is no value preview during sliding. First I must release the slider and then I actually realize what value I choose. I don’t know did I explaned ok. :slight_smile: Thanks for quick support. :slight_smile:

Yep, it is a bug, will fix it today under the same version.

1 Like

Everything works perfect now. Thanks again. :slight_smile:

I thought I was seeing things when the slider was not showing movement when I was making changes.
Uninstalled Blynk and reinstalled and now works.

Denny

5 posts were split to a new topic: Change of the slider sends the value double with a BLYNK_WRITE(V35) command