Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Csv auto range for Arduino Serial Plotter #876

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mgesteiro
Copy link

Added an auto range feature to the CsvOutput class so data could be visualized easier in the Arduino Serial Plotter, specially in the 2.x IDE version: audio data is better observed when the range doesn't continually change.

Also fixed some errors in the code (including a down-casting from Tto int).

By the way, this feature is transparent: previous code would world exactly as it was doing before.

Best regards!

Screenshot 2023-05-30 at 21 29 00

@pschatzmann
Copy link
Owner

I don't like this idea: If you think that if you need a clipping functionality, it would be better to implement a ClippingStream (similar to VolumeStream). Or maybe using the VolumeStream actually give more correct result.

@mgesteiro
Copy link
Author

It's not -by any means- a clipping feature: it's just a visual aid for the Serial Plotter. Did you at least try it? Did you see the screen capture?

In Arduino IDE 2.x the Serial Plotter is practically unusable for me as the visualization jumps constantly with the vertical axis changing its range continuously, specially when debugging a problem with an ADC. I'm aware this is a Serial Plotter thing, but so it is the CsvOutputclass (it's basically intended for the Serial Plotter, right?).

Of course is up to you: it's your project.

Do you want a separate PR for the fixes in the first commit of this PR? (The hardcoded Serial writes and the downcasting error...)

Best regards

@pschatzmann
Copy link
Owner

pschatzmann commented May 31, 2023

No, I just tried to review your code and the only functionality that I could find was some clipping.
What did I miss ?
Maybe it would help if you explain your logic...
If you prefer to freeze the output you could just limit your output e.g. with copier.copyN(10);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants