Table of Contents

Serial Macro Extensions

Introduction

This plugin provides methods to talk to a device attached to a serial port, directly from the ImageJ Macro language, using the Macro Extension mechanism. You can easily:

It works with any serial device, but was developped to talk with the Arduino board, an open-source electronics prototyping platform (http://arduino.cc/).

See also

Authors

Jérôme Mutterer, Tom Mueller, Graeme Awcock, Michael Schmid

Installation

Windows

Other platforms

Usage

run("serial ext");
ports = Ext.ports();
Ext.open("COM8",9600,""); // this is enough e.g. for the Arduino, defaults parameters are DATABITS_8,STOPBITS_1,PARITY_NONE
Ext.open("COM1",14400,"DATABITS_8 STOPBITS_2 PARITY_ODD"); // advanced serial port configuration

// Available options

// DEFAULT: 8 data bits, 1 stop bit, no parity
 
// Databits:
// DATABITS_5
// DATABITS_6
// DATABITS_7
// DATABITS_8

// Stopbits:
// STOPBITS_1
// STOPBITS_2
// STOPBITS_1_5

// Parity:
// PARITY_NONE
// PARITY_EVEN
// PARITY_ODD
// PARITY_MARK
// PARITY_SPACE
data = Ext.read();
Ext.write("a");
Ext.close();
active = Ext.alive();
// returns "0" or "1"

Download

History