You are using the comma (,) where you’d need to use the decimal dot (.) in 0.97 & 1.03.
And pubgoogle; is not a function call.
You can write this slightly different
bool ration_change() {
// when ratio is outside of interval
if ( ratio < last_ratio * 0.97 || last_ratio * 1.03 < ratio ) {
pubgoogle();
last_ratio = ratio;
}
}
thanks a lot for your help, what a stupid mistake a could not see… comma ( , . ).
i fixed it and it work.
i also like your all in one test.
The Pubgoogle() is a fonction that pushed data to google, using spark.publish, with delimiter, then I used cloud function to push data to big query.
see extract of the function.
String text6=String(volt,0); // Vin monitoring without the . so divided by 100
text0 = text1+';'+text2+';'+text3+';'+text4+';'+text5+';'+text6+';'+text7+';'+text8+';'+text9+';'+text10;
Spark.publish("DATA ",text0,60,PRIVATE);