I'm developing a simple code to soften a Temperature input with an EMA filter.
The problem I have, is that the serial motinor is displaying everything as it should, but the plotter is not. I tried reseting the program but it doesn't work.
I'm using an Arduino (Elegoo) Uno.
IDE 2.0.4
double LecturaTa;
double Ta;
double EMA;
double EMA1;
void setup() {
Serial.begin(9600);
pinMode(A0, INPUT);
}
void loop() {
LecturaTa = analogRead(A0);
Ta = (4675.0/(log(-(50000.0*LecturaTa)/(0.00797165*LecturaTa-8.154998))))-273.15;
Serial.print("La Temperatura es: ");
Serial.print(Ta);
Serial.print(" ºC");
Serial.print(" La Media Movil Exponencial (EMA) de 0'06 es: ");
EMA = 0.06*(Ta)+(1-0.06)*EMA1;
Serial.print(EMA);
Serial.println("ºC");
EMA1 = EMA;
}
Your topic was MOVED to its current forum category which is more appropriate than the original as it has nothing to do with Installation and Troubleshooting of the IDE
Which Arduino board and version of the IDE are you using ?
This is a valid solution (maybe the only one) for the problem I had.
I tried different options and it looks like the plotter only understands the text before ":" and the variable right after it.
I don't know how UKHeliBob manages to get it plotted with the original code, I would like to know because it was (as you said) a more human way of expressing it.
Thank you a lot
PS: It's still sketchy, I still have trouble getting the plotter to understand I want to plot all variables, but I managed to do it. (I used fixed values to mantain the graph stable between values and not autoadjust.
I could not remember the correct format for the data to be plotted so was experimenting. All I did was to change
Serial.print(" La Media Movil Exponencial (EMA) de 0'06 es: ");
to
Serial.println(" La Media Movil Exponencial (EMA) de 0'06 es: ");
and got output on the plotter. I did not check that the output was reasonable, just that it was there and that the plot varied when changing the analogue input