iOS vs Android slider value mismatch

Hi Blynk team,

I’ve a Slider widget in my project its value ranging from 3000 to 3700. I see that there is a mismatch between IOS and Android app. If i read 3500 in IOS the reading on Android is 3300.
May you help me ?

Regards

Does the problem persist after project restarting? This will help sync project settings between apps.

What pin sliders are assigned to? Do you affect pin value from your code?

Hi @Eugene,

yes after restarting Blynk app on iPad and Android phone the mismatch still remains.

The slider is connected to V4 :

//Slider change values from 3000 to 3700 from Widget Slider
 BLYNK_WRITE(V4)
 {   
   SliderValue = map(param.asInt(), 0, 1023, 3000, 3700);    
 } 

Its seems my code doesn’t affect pin value.

Could you please provide more info. It is not clear from description what exactly is wrong. Maybe some steps to reproduce?

@zetalif please go to your slider widget settings and disable mapping
http://docs.blynk.cc/#widgets-common-widget-settings-data-mapping

ok,

in my project I use slider to set the minimum Esp voltage value (Esp8266_02 powered by battery) to put Esp8266 in sleep mode.
In the sketch i map the slider range value (0-1025) to the voltage value (3000-3700). The same range I use in the widget settings : 3000 - 3700.
The question is that when I vary on IOS the value is different from Android (i.e. 3294 on IOS correspond 3000 on Android).

ESP8266-07 Standalone
//
// Esp voltage reading to Blynk
// Pin physical drive on ESP8266
// Low voltage setting for Deep Sleep
// 
// Deep sleep for 600 sec (GPIO16 connected to RST) 
//
// Arduino IDE parameters : 
// - NodeMCU 0.9 (ESP-12 Module)
// - 80 MHz
// - Serial
// - 115200
// - 4M (3M SPIFFS) 
//
// Virtual PIN
// V1 : EspVCC readings
// V2 : Led physical pin status On/Off
// V3 : Slide button for physical pin
// V4 : Slider for deep sleep Vcc low limit value setting
// V5 : Led for deep sleep mode status
// V7 : Humidity DHT11
// V8 : Temperature DHT11

 
// #define BLYNK_PRINT Serial 
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <DHT.h>

ADC_MODE(ADC_VCC);
int Led = 5 ; // pin for led
int SliderValue;

// Pin for DHT11
#define DHTPIN 4
DHT dht(DHTPIN, DHT11);
float Humidity;
float DHT_Temp;

char auth[] = "";

WidgetLED led1(V2);
WidgetLED led2(V5);

SimpleTimer timer;  

// Keep this flag not to re-sync on every reconnection
bool isFirstConnect = true;
// This function will run every time Blynk connection is established
BLYNK_CONNECTED() {
if (isFirstConnect) {
Blynk.syncAll();
isFirstConnect = false;
}

led1.off(); 
led2.off();
}

 
 void setup() {                
 led2.off();
 // Serial.begin(115200);

dht.begin();
 
 pinMode (Led, OUTPUT) ; 
 digitalWrite (Led, LOW);

 Blynk.begin(auth, "");
 timer.setInterval(5000L, ReadSensor);
 Blynk.notify("ESP8266-BLYNK Ready");
 }
 
 
  void loop() {
   Blynk.run();
   timer.run();
  }


//Function to read Esp voltage and check deep sleep low voltage value (to safe battery!!)
void ReadSensor() {  
Blynk.virtualWrite(V1, ESP.getVcc());

Humidity = dht.readHumidity();
DHT_Temp = dht.readTemperature();
Blynk.virtualWrite(V7, Humidity);
Blynk.virtualWrite(V8, DHT_Temp);

// Serial.println(ESP.getVcc());
// Serial.println(SliderValue);

if (ESP.getVcc() < SliderValue)
{
led2.on();
Blynk.notify("Deep Sleep");
ESP.deepSleep(600000000);
delay(100);
}
}


//Switch button to drive the physical pin
BLYNK_WRITE(V3)
{
int pinValue = param.asInt();
if (pinValue==1) 
{
digitalWrite (Led, HIGH);
led1.on();
} else {
digitalWrite (Led, LOW);
led1.off(); 
}
}


//Slider change values from 3000 to 3700 from Widget Slider
 BLYNK_WRITE(V4)
 {   
   SliderValue = map(param.asInt(), 0, 1023, 3000, 3700);    
 }