The Arduino library bundled with MegunoLink provides classes to send data to our visualizers. There is one visualizer class for each visualizer, as shown in the table below. The classes provide methods for sending the data in the right format.

Using the Library

To use a visualizer class in your Arduino sketch:

  1. Install the MegunoLink library into your Arduino library folder
  2. #include "MegunoLink.h" — to make the library available to the sketch
  3. Create an instance of the visualizer class. This just means creating a variable such as TimePlot MyPlot;
  4. Call methods on the instance variable when you want to send data. For example: MyPlot.SendData("ADC Value", analogRead(0));

The visualizer class variable can be in the global scope (at the top of your sketch), or in the function right before you use it. Generally it is easier to place it in the global scope, especially if you are using channels.

Channels and Serial Ports

The methods of each visualizer class send data to the default channel on the standard Arduino Serial port. Include the channel name and Serial port in the constructor when you create the visualizer class variable to send data to a different channel or port.

For example, to send data to a channel named SetPoints on Serial1 declare your TimePlot variable as:

Visualizer Class Reference Pages

Visualizer Library Reference
Time Plot Time Plot Library
X-Y Plot X-Y Plot Library
Interface Panel Interface panel Library
Message Monitor Message Monitor Library
Table Table Library
Map Map Library


Here is a simple example that generates a cosine function and sends it to a time plot.

Recent Posts

Leave a Comment

Start typing and press Enter to search