The following visualizers support channels:
- Message Monitor
- Time Plot
- XY-Plot
- Property Table
- Record Table
- Interface Panel (MLP UI Message Processor)
Sending to Channels using Arduino Library
Our library for sending Arduino data to MegunoLink supports channels. When you construct a new variable to send data to MegunoLink, put the channel name as the first parameter.
For example, create variables to send data to a channel named “Battery” and a channel named “Temperature” on a MegunoLink plot as follows:
1 2 3 4 5 6 7 8 9 |
#include "MegunoLink.h" void SendDataToMegunoLink() { TimePlot BatteryPlot("Battery"); TimePlot TemperaturePlot(F("Temperature")); // etc. } |
Selecting Channels in MegunoLink
By default, MegunoLink’s visualizers show data from all channels. Use the channel selector on the visualizer’s toolbar to select the channels you want to show on the visualizer.
On the channel selector drop-down you will see:
- Select Default: include the default channel. A box will be drawn around the Select default menu item when the default channel is included. The default channel is used when you don’t supply any other channel name.
- A list of channels that MegunoLink has detected. Check the box next to the channel name to include it.
- Select all: check all of the channels in the list to include them.
- Select none: uncheck all of the channels in the list to exclude them.
- Select new automatically: automatically include any new channels that MegunoLink detects.
Flash Strings and Global Variables
It is generally recommended to reference strings in flash memory on the AVR Arduino platform to save RAM. The F(…)
macro makes this easy inside functions:
1 2 3 4 5 6 7 8 9 |
#include "MegunoLink.h" void SendDataToMegunoLink() { TimePlot BatteryPlot(F("Battery")); TimePlot TemperaturePlot(F("Temperature")); // etc. } |
However, this same macro will produce compiler errors if you try to use it for global variables:
1 2 3 4 5 |
#include "MegunoLink.h" // The F(...) macro doesn't work for global variables. This will // produce a compiler error: TimePlot BatteryPlot(F("Battery")); |
To work around this limitation, and place strings in program memory, declare a variable to hold the flash string separately:
1 2 3 4 5 6 7 |
#include "MegunoLink.h" // A variable to reference the flash memory string: const char Channel[] PROGMEM = "Battery"; // Cast the channel variable so the library knows to look for the string in flash memory: TimePlot BatteryPlot((const __FlashStringHelper*)Channel); |
More Information
You can find more information on channels in the following articles: