nathandunk / BetterSerialPlotter

A drop-in replacement for the arduino serial plotter
MIT License
162 stars 25 forks source link

Setting data labels of the BSP from the device application #30

Open ramdgn opened 6 months ago

ramdgn commented 6 months ago

Hi,

Thank you for the great application. I would like to suggest a feature, which would make life easier with setting the data labels. So, taking your demo with the suggestion would look like:

void loop(){
    // get all of our variables of interest
    float t = millis()/1000.0;
    float var_sin = sin(t); // sin(t)
    float var_cos = cos(t); // cos(t)

    // write them all to console with tabs in between them
    Serial.print("Time\t");
    Serial.print(t);         // first variable is program time in seconds. This can be plotted on an x-axis!
    Serial.print("\tSine\t");
    Serial.print(var_sin);   // second variable is sin(t)
    Serial.print("\tCosine\t");      // this last "\t" isn't required, but doesn't hurt
    Serial.println(var_cos); // third varible is cos(t). make sure to finish with a println!

    // For example, at 2.5 seconds, this prints out like so, where \t
    // is the tab character, and \n is the newline character
    // 2500\t0.598\t-0.801\t\n
}

Where the data labels are 'Time', 'Sine', 'Cosine'. The logic is that any non digit character (excluding the minus sign '-') till the white space is the preceding label of the data.

Other, more complex idea, is to be able to send the setting (json or other format) from the application to the Plotter so no setting at all (besides com port setting) is necessary.

Thank you for consideration.

shyney7 commented 4 months ago

This is an essential feature for every serial plotter, but I don't think that this repo is being maintained.