I set slider with #.# dec but after run blynk again slider return to # dec. My slider in tab 2. The error by blynk or by my project ? Thanks
Since we can’t see your code, we can’t tell
Sorry, My project :
#include <WiFiManager.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <BlynkTimer.h>
#include <PZEM004T.h>
PZEM004T pzem(05,04); // RX,TX
IPAddress ip(192,168,1,1);
char auth[] = "******";
int wifisignal;
float eh,ion,inormal,idif, iunload;
WidgetLED led1(V21);
WidgetLED led2(V22);
WidgetLED led3(V23);
WidgetLED led4(V24);
WidgetLED led5(V25);
WidgetLED led6(V26);
BlynkTimer timer;
void setup()
{
Serial.begin(115200);
pzem.setAddress(ip);
WiFiManager wifiManager;
wifiManager.autoConnect("HVAC P1");
wifiManager.setTimeout(300);
//reset saved settings
//wifiManager.resetSettings();
Blynk.config(auth,******,8442);
sensors.begin();
timer.setInterval(3000L, Senddata);
}
void loop()
{
Blynk.run();
timer.run();
}
BLYNK_CONNECTED() {
Blynk.syncAll();
}
BLYNK_WRITE(V13){
ion = param.asInt();
}
BLYNK_WRITE(V14){
inormal = param.asInt();
}
BLYNK_WRITE(V15){
idif = param.asInt();
}
BLYNK_WRITE(V16){
iunload = param.asInt();
}
void Senddata()
{
float v = pzem.voltage(ip);
Blynk.virtualWrite(V7, v);
float i = pzem.current(ip);
Blynk.virtualWrite(V8, i);
float p = pzem.power(ip);
Blynk.virtualWrite(V9, p);
float e = pzem.energy(ip);
eh=e/1000;
Blynk.virtualWrite(V10, eh);
Blynk.virtualWrite(V13, ion);
Blynk.virtualWrite(V14, inormal);
Blynk.virtualWrite(V15, idif);
Blynk.virtualWrite(V16, iunload);
}
In Blynk V13 14 15 16 i set by slider with decimals #.# but after close and open blynk again, decimal return to #.
Well, I don’t see anything in your code that could be inadvertently resetting the sliders. And in any of my projects the decimal ranges stay as set. So try uninstalling and reinstalling the App (your projects are saved on the server).
All error come by Local Server. Already fix after update. Thanks Bro Gunner
Hi @Gunner, I have trouble with this, after syns with vertical slider V13 V14 V15 V16 with #.# decimals, it’s ok in slider, but after that Display in V 17 V18 V19 V20, it round to interger number
?
#include <WiFiManager.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <BlynkTimer.h>
#include <PZEM004T.h>
PZEM004T pzem(05,04); // RX,TX
IPAddress ip(192,168,1,1);
char auth[] = "******";
int wifisignal;
float eh,ion,inormal,idif, iunload;
BlynkTimer timer;
void setup()
{
Serial.begin(115200);
pzem.setAddress(ip);
WiFiManager wifiManager;
wifiManager.autoConnect("HVAC P1");
wifiManager.setTimeout(300);
//reset saved settings
//wifiManager.resetSettings();
Blynk.config(auth,******,8442);
sensors.begin();
timer.setInterval(3000L, Senddata);
}
void loop()
{
Blynk.run();
timer.run();
}
BLYNK_CONNECTED() {
Blynk.syncAll();
}
BLYNK_WRITE(V13){
ion = param.asInt();
}
BLYNK_WRITE(V14){
inormal = param.asInt();
}
BLYNK_WRITE(V15){
idif = param.asInt();
}
BLYNK_WRITE(V16){
iunload = param.asInt();
}
void Senddata()
{
float v = pzem.voltage(ip);
Blynk.virtualWrite(V7, v);
float i = pzem.current(ip);
Blynk.virtualWrite(V8, i);
float p = pzem.power(ip);
Blynk.virtualWrite(V9, p);
float e = pzem.energy(ip);
eh=e/1000;
Blynk.virtualWrite(V10, eh);
Blynk.virtualWrite(V17, ion);
Blynk.virtualWrite(V18, inormal);
Blynk.virtualWrite(V19, idif);
Blynk.virtualWrite(V20, iunload);
}
Isn’t this your problem? If you want your code to treat these slider values as floating point decimals then I would have thought that param.asFloat would have been more appropriate.
Pete.