Plotting Arduino Data
From EmbeddedSand
Contents |
MegunoLinks Plotting Tool
One of MegunoLink's main features is the ability to plot data sent from a serial port in real time. To quickly take advantage of this download our Arduino Graphing Library here. It includes three example programs to get your going, plotting analog to digital values, plotting digital logic data, and plotting generated sinusoidal data.
Once you have programmed the Arduino with one of our examples or your own plotting code simply hit the connect button in MegunoLink. If the serial monitor is enabled you will see the plotting packets coming in. MegunoLink will intercept any of these packets that match our plotting structure and plot them on screen in real time. The current format is shown below.
{SeriesName, T, DataValue}
"SeriesName" is a text string that contains a description of the data. It will be used as a series name in the legend of the plot. T indicates the x-axis will be time (in the future more options will be supported for the x-axis value). Finally "DataValue" contains the data you want to plot.
Plotting Function
An alternative approach to the library is to create your own simple function to print data in the format our plotting tool expects. An example can be seen in the codeblock. This can be easily ported to other microcontrollers and serial devices.
- void sendPlotData(String seriesName, float data)
- {
- Serial.print("{");
- Serial.print(seriesName);
- Serial.print(",T,");
- Serial.print(data);
- Serial.println("}");
- }
MegunoLink Plotting In Action
Check out MegunoLink's plotting/graphing features in action.
Download
Download MegunoLink from the button below.
| If you find MegunoLink useful, please consider a donation to help support future development |
Like MegunoLink? Check out our technical report templates for Microsoft Word. Increases your productivity and helps give your technical writing a professional look.
