zbeeasy
September 11, 2023, 9:48pm
1
I have an arduino uno, and i'm using it to read an EMG, the serial montior is working just fine, but i cant have the graphic on the plotter
My code:
void setup() {
Serial.begin(9600);
}
void loop() {
float sensorValue = analogRead(A5);
float milivolt = (sensorValue / 1023) * 5;
Serial.print("Sensor Value: ");
Serial.println(sensorValue);
Serial.print("Voltage: ");
Serial.print(milivolt * 1000);
Serial.println(" mV");
delay(400);
}
zbeeasy
September 11, 2023, 10:33pm
3
how does this help? I already tried everything, but only in the plotter, the variable doesn't count
In your code, you're printing both text strings and numerical values, which can confuse the Serial Plotter. The Plotter is expecting just numerical values to plot.
zbeeasy
September 11, 2023, 10:48pm
5
now it plots like the i was the same value
zbeeasy
September 11, 2023, 10:49pm
6
i already used the plotter with text strings, and in the arduino tutorial they use it too
try using float milivolt = (sensorValue * 5.0) / 1023.0;
instead.
What if you try like this:
void loop() {
float sensorValue = analogRead(A5);
float milivolt = (sensorValue / 1023) * 5;
Serial.print("Sensor:");Serial.print(sensorValue);
Serial.print(",");
Serial.print("mV:");Serial.println(milivolt * 1000);
delay(400);
}
2 Likes
zbeeasy:
how does this help?
It explains the rules, which in turns, explains why your program did not work.
1 Like
system
Closed
March 10, 2024, 4:05am
12
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.