MegunoLink and the Arduino IDE work together to create your project:

  1. Create your Arduino sketch using your own code and any of the widely available libraries for sensors, motors and controllers.
  2. Create a custom interface using MegunoLink visualizers.
  3. Send data and commands from your Arduino sketch to MegunoLink using our Arduino library.
  4. Handle commands sent from MegunoLink to call functions in your Arduino sketch using the command handler in our Arduino library.

Set up Arduino Integration

Select Setup Arduino Integration from MegunoLink’s ⚙ menu to install/remove our Arduino integration.

Arduino Library

The MegunoLink library for Arduino includes classes to send data and commands to visualizers, and classes to receive commands and call a function in your Arduino sketch.

The visualizer classes (TimePlot, XYPlot and InterfacePanel, for example) create and send special messages that MegunoLink decodes. The plotting data guide provides a detailed walk-through. These messages are sent to the serial port, by default (Serial), though the destination can be changed.

The command handler classes decode messages sent to your Arduino Serial port, by default. These could be commands sent by buttons on a MegunoLink interface panel. The guide process serial commands with an Arduino walks through the steps for using the command handler while the Arduino interface building guide talks about building an interface panel to send commands.

Arduino library example

Here’s a simple sketch that sends measurements from analog port 0 to a time plot visualizer. A command, SendData, starts and stops transmission of the data.

The ArduinoTimer is a utility class, included in our library, for executing a function periodically.

Upload Monitor

MegunoLink’s upload monitor solves the port contention problem. That’s the avrdude: ser_open(): can't open device "\\.\COM4": Access is denied error in the Arduino IDE when another application is using the Arduino serial port needed to program your device. Two applications can’t use one serial port at the same time.

Our upload monitor is triggered when the Arduino IDE uploads a program to your Arduino. MegunoLink releases the serial port so the upload can continue. When the upload completes, MegunoLink will reconnect to the serial port to monitor your data.

This all happens automatically once you’ve installed the upload monitor.

Open Arduino Code

Select Open Arduino code from the MegunoLink open menu to open your sketch in the Arduino IDE.

MegunoLink looks in the folder where your MegunoLink project is saved to find the Arduino code for your project. It opens the .ino file with the same name as the parent folder if present, or the first .ino file in the MegunoLink project file folder otherwise.

Open Arduino code file.

Open the project’s .ino sketch in the Arduino IDE.

What's Next?

With Arduino integration sorted you are ready to:

This is just a small selection of what you can do with MegunoLink. Explore the documentation contents in the side bar to learn more.

Start typing and press Enter to search