-
Notifications
You must be signed in to change notification settings - Fork 31
Installation and Quickstart
Search for Plotter in the Arduino Library Manager.
or
Install manually with the ZIP file of Plotter.
Download one of the following stand-alone listener options. Keep the folder intact so the application can access the library and source folders. (Java Runtime Environment 8 required)
- Windows 32-bit
- Windows 64-bit
- Linux 32-bit
- Linux 64-bit
- Mac OS X (See page for Issue with stand-alone listener on Mac OS X)
or
Download the source directory from this repository ( listener/ ) and run that with the Processing IDE.
Include library
#include "Plotter.h"
Declare global variables. Any variable that you want plotted should have global scope. You will also want the Plotter object to be accessible globally.
double x;
Plotter p;
Start the Plotter and add graphs as desired. When adding graphs, the first argument is a String with the title of the graph and the second argument is an int with the number of points displayed at any given time. These two arguments are followed by a String and your corresponding variable.
void setup()
{
p.Begin(); // start plotter
p.AddTimeGraph( "Some title of a graph", 500, "label for x", x );
}
Update variables as you normally would and call plot whenever you are ready. This example simply assigns arbitrary sine data.
void loop()
{
x = 10*sin( 2.0*PI*( millis() / 5000.0 ) );
p.Plot(); // usually called within loop()
}
Once the Arduino is running, start the listener application that you setup above.
The application will configure itself and your data should be plotted appropriately.