// Processing code:
// Simple Serial read
// adapted from example by Tom Igoe
// (Assumes ASCII data coming in serial port)
//-------------------------------------------
import processing.serial.*;
Serial myPort; // The serial port
void setup() {
size(200, 200);
// List all the available serial ports:
printArray(Serial.list());
// Open the port you are using at the rate you want:
myPort = new Serial(this, Serial.list()[2], 9600);
}
void draw() {
while (myPort.available() > 0) {
String inBuffer = myPort.readString();
println(inBuffer);
}
}
|