Hi guys. I have a problem with showing paresInt to virtual pin (V2). the problem is Decimal numbers not showing correctly. For example, instead of displaying the number 20070.84, it incorrectly displays the number 8420070.
thanks for any help.
the sketch:
#include<SoftwareSerial.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
SoftwareSerial period(4, 5);
SoftwareSerial periodavg(12, 14);
BlynkTimer timer;
int age1;
int age2;
char auth[] = "WJz71rs0YRqdaZ9oh1VysC_rjvwwx4Re";
char ssid[] = "MikroTik";
char pass[] = "12345678";
char server[] = "10.5.51.5";
void setup() {
Serial.begin(9600);
period.begin(9600);
periodavg.begin(9600);
Blynk.begin(auth, ssid, pass, server, 8080);
timer.setInterval(1000L, pw);
timer.setInterval(1000L, pa);
}
void pw() {
age1 = period.parseInt();
Blynk.virtualWrite(V1, age1);
Serial.println(age1);
}
void pa() {
age2 = periodavg.parseInt();
Blynk.virtualWrite(V2, age2);
Serial.println(age2);
}
void loop()
{
Blynk.run();
timer.run();
}