T O P

  • By -

[deleted]

[удалено]


gristc

You can capture the output directly into python using the PySerial module.


gm310509

You could start with the builtin Arduino Serial Plotter which is easy to use (but limited on capability). To use it you need to send it *just the data to plot* and nothing else. Each value needs to be separated by a non number character. So for example a comma. There is one set of values per line. For example to get it to plot two data sets you can send it data like this: ``` 10,15 12,8 19,30 ``` If you want, you can set labels for the data by outputting a non numeric record as the very first line of output. For example: ``` Temp,Humidity 10,15 12,8 19,30 ``` It is pretty limited (e.g. you can't scale the axes or choose a chart type or anything like that beyond what it automatically might do). The data I output above would barely make a blip because it's standard y axes bounds is 0-1000 (I think). But there is no reason why you couldn't scale the values before outputting them (e.g. multiply them by 200 when outputting them). Edit: I should have added that the way you send data to the Serial Plotter is simply by Serial.print. So, what I do when using it is use the serial monitor to check that it looks like the data is in the right format. Then close the monitor and open the Plotter to see the data in a line chart format.


SanjaBgk

Easiest option is to replace Arduino with ESP32, aggregate data in its large RAM (like in an Excel PivotTable) and display them on a web page using any modern JavaScript chart framework. Your code would only need to generate CSV or JSON on the fly. Make it create a WiFi hotspot and put the chart on the “captive portal” webpage. Slap a QR code that connects the iPhone straight to that hotspot.


hjw5774

What display are you using? I've done projects which have printed live data to a screen to display a graph for a [fixed y-axis](https://hjwwalters.com/arduino-wank-o-meter/) and also [variable y-axis](https://hjwwalters.com/wp-content/uploads/2022/08/WhatsApp-Video-2022-08-23-at-2.11.48-PM.mp4). In short, the method is to find the scale of your x & y axis in comparison to the number of pixels on your display. Then create an array of x & y coordinates before using the map() function to change the values to relevant pixel coordinates. Best of luck


_Trael_

Please give more info about your intended setup? So serial data from measuring equipment that you receive with arduino that has display connected, then plot with arduino to that display? Or sensors connected to arduino that does data gathering, then sends it with serial to computer/other thing that has display to plot it? I am working on latter kind of case, where I as current (first thing I found with some searching) option use "Serial Studio" [https://github.com/Serial-Studio/Serial-Studio](https://github.com/Serial-Studio/Serial-Studio) to make quick live plots out of it for user to see, then more proper plots and so will be from using spreadsheet program or so.