Weird thing, the value display widget gives the wrong value:
Code:
void updateBlynk(){
if (blynkUpdate){
Serial.print("Blynk update, current / target T: ");
Serial.print(currentT);
Serial.print(" / ");
Serial.println(targetT);
Blynk.virtualWrite(V3, targetT);
Blynk.virtualWrite(V4, currentT);
Blynk.virtualWrite(V5, heatOn*200);
Blynk.virtualWrite(V6, valveMaintenanceCycle*200);
Blynk.virtualWrite(V7, errorFlag*200);
blynkUpdate = false;
}
}
Serial output:
Blynk update, current / target T: 21.18 / 12.00
while the values on the Blynk display are:
currentT: 0.97 (shifting constantly to nearby values and more often then I actually call the Blynk update routine)
targetT: 401 (constantly increasing one step at a time)
Only when the data is pushed (so when I see a serial update I notice that the ‘value display’ very briefly gives the right value and changes back again.
Note:
- the above routine are the ONLY Blynk.virtualWrite() nowhere else in the code is that function called.
Also V3 and V4 are NOWHERE else used in the code. - updateBlynk is on a timer, called every second or when the targetT is changed (either by the app itself or by external physical buttons).
full code: https://www.dropbox.com/s/lmibvsj4o30qxn1/Heating_Thermostat_Shared.ino?dl=1