ActionScript?
ArduinoFio?
------
&color(foreground[,background]){text};
&color(foreground[,background]){text};
&color(foreground[,background]){text};
Firmata.begin(57600);
&color(foreground[,background]){text};
&color(foreground[,background]){text};
server: port: 9000 io: type: Fio port: COM9 baudrate: 57600
import processing.funnel.*; final int id = 1; // end device ID final int kChannles = 1; // the number of channels to display Fio fio; Scope[] scope; void setup() { size(340, 35+150*kChannles); frameRate(30); int[] moduleIDs = {id}; fio = new Fio(this, moduleIDs, Fio.FIRMATA); scope = new Scope[kChannles]; for (int channel = 0; channel < kChannles; channel++) { scope[channel] = new Scope(30, 35+150*channel, 200, 100, "A"+channel); } } void draw() { background(0); for (int channel = 0; channel < kChannles; channel++) { scope[channel].updateAndDraw(fio.iomodule(id).analogPin(channel)); } } class Scope { private int l; private int t; private int h; private float values[]; private int index = 0; private int points = 200; private String title; Scope(int l, int t, int w, int h, String title) { this.l = l; this.t = t; this.h = h; this.points = w; this.title = title; values = new float[this.points]; } public void updateAndDraw(Pin pin) { values[index] = pin.value; smooth(); textSize(12); text(title, l - 24, t - 8); text("1.0", l - 24, t + 8); text("0.0", l - 24, t + h); text("val: " + pin.value, l + points + 8, t + 8); text("max: " + pin.maximum, l + points + 8, t + 20); text("min: " + pin.minimum, l + points + 8, t + 32); text("avg: " + pin.average, l + points + 8, t + 44); // draw outlines stroke(200); noFill(); beginShape(); vertex(l - 1, t - 1); vertex(l + points, t - 1); vertex(l + points, t + h); vertex(l - 1, t + h); endShape(CLOSE); // draw the signal stroke(255); beginShape(); for (int i = 1; i < points; i++) { vertex(l + i, t + h - values[(index + i) % points] * (float)h); } endShape(); index = (index + 1) % points; } }
($Processing)\libraries\funnel\library\settings.fio.txt Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 baudrate: 57600 API MODE: 2 FIRMWARE VERSION: 10E6 (XBee 802.15.4) PAN ID: 1234 SOURCE ADDRESS: 00 opened host address 127.0.0.1 ececCode /reset reboot OK module registerd [Fio] addModule() Fio.ID01 1 notify thread start Discovering nodes... NODE: MY=1, SH=13a200, SL=40526a67, dB=47, NI=' ' configureation OK funnelServiceThread start Firmata Protocol Version: 2.1 Discovering nodes... Discovering nodes...&color(foreground[,background]){text};