How to save serial monitor output to PNG

Hello there, I'm trying to save some results in an analog-read value of an EMG module. I followed the steps in this link: Designing an Arduino-based EMG monitor. I would like to find a way to save the printed signal waves from the serial monitor in a picture format. Thank you to those who'd help me with it.

by using the Snipping Tool?

the Serial plotter does not really have a constant time base ➜ if you don't print your samples using a regular period you'll get a distorted curve

the code they propose for the loop runs as fast as possible

EMGVal = analogRead(EMGPin);
Serial.println(EMGVal);

and will likely saturate the Serial port even at 115200 bauds which will make println() blocking and the next sample will occur a bit later.

you might want to print the time and the value

EMGVal = analogRead(EMGPin);
uint32_t captureTime = millis();
Serial.print(captureTime); Serial.write(','); Serial.println(EMGVal);

and spit that out in a CSV file, open under Excel/Numbers/your favorite spreadsheet and use the first column as time base and second column as value.

I would also bump the baud rate to a higher value, may be 1 or 2 million so that the Serial communication does not slow down too much the acquisition process.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.