Home

stefanhoelzl edited this page Feb 10, 2013 · 34 revisions
Clone this wiki locally

ArduinoMonitor

User Interface

ArduinoMonitor

Graphs

  • Mouse wheel: zooms the vertical Axis
  • Right mouse button + mouse wheel: zooms the horizontal Axis
  • Left mouse button + move mouse: pans the graph
  • Double-click: resets the graph
  • with the 'Config Graphs' button you can configure the position and style of a graph

Import/Export

With the Import/Export buttons in to upper right corner you can save/load your recordings.

Usage

Binaries

For MacOS X there are binaries available

Sources

Just start the Python-script ./ArduinoMonitor.py or python ArduinoMonitor.py

Requirements

Arduino-Libraries

  • static void begin(int baudrate);
  • starts the communication with the ArduinoMonitor (see Serial.begin())
  • baudrate: speed of the serial communication
  • static void initGraph(char identifier, char cfg, char* pos);**
  • configures the appeareance of a graph
  • identifier: string with identifies the graph
  • cfg: string which configures the graph, e.g. 'r--' for a dashed red line see Matplotlib
  • pos: sets the position of the graph see Matplotlib
  • static void initGraph(char identifier, char cfg);**
  • see initGraph(char* identifier, char* cfg)
  • sets the position to '111'
  • static void clearGraph(char identifier):*
  • removes all points of a graph
  • static void graph(float x, float y, char identifier);*
  • draws a point to the graph
  • x: x value
  • y: y value
  • identifier: identifier of the graph where the point is added
  • static void graph(float y, char identifier);*
  • draws a point to the graph (as x value is the current time in milliseconds used)
  • y: y value
  • identifier: identifier of the graph where the point is added
  • static void status(char identifier, char message);**
  • show a value in the status window
  • identifier: identifier of the status value
  • message: message which depends to the status identifier
  • static void status(char identifier, float value);*
  • see status(char* identifier, char* message)
  • static void println(char message);*
  • like Serial.println(char* message)
  • static void println(float value);
  • like Serial.println(float value)
  • static void print(char message);*
  • like Serial.print(char* message)

Example

#include "Arduino.h"
#include "Monitor.h"
 
void setup()
 {
    Monitor::begin(9600);
    
    Monitor::initGraph("a(x)", "r-", "211");
    Monitor::initGraph("s(x)", "b--", "223");
    Monitor::initGraph("x", "g*", "223");
 }

float i = 0;

void loop()
 {
    unsigned long t = millis();
    float a = sin(i);
    float s = cos(i) + 0.5;
    i+=0.1;
    if(i>6.28)
    {
        i=0;
        Monitor::graph(t, i, "x");
    }
    
    Monitor::graph(t, a, "a(x)");
    Monitor::graph(t, s, "s(x)");
    
    Monitor::status("Time (s)", t/1000.0);
    Monitor::status("x", i);
}