::::::::::::::::   Anne Hong    
::::::::::::::::   NYU | Tisch School | ITP  
::::::::::::::::   MPS Candidate-2007  
::::::::::::::::   studio@annehong.com  
::::::::::::::::   Networked Objects
     

Josh Cheng
Anne Hong
Kazuhiro Nozaki
Max Weng

         
       

Physical Prototype of Final Project

Getting a Serial Connection with the RFID Reader to Flash

Processing Code for serial call-and-response using RFID Reader. On a mac laptop, the port is 2, and on a G5, change the port to 0:

// Serial call-and-response for v.85
// by Tom Igoe

// Sends a byte out the serial port, and reads 3 bytes in.
// Sets foregound color, xpos, and ypos of a circle onstage
// using the values returned from the serial port.
// Thanks to Daniel Shiffman for the improvements.

// Created 21 March 2005
// Updated 16 Feb. 2006

import processing.serial.*;

int bgcolor; // Background color
int fgcolor; // Fill color
Serial port; // The serial port
int[] serialInArray = new int[0]; // Where we'll put what we receive
int serialCount = 0; // A count of how many bytes we receive
int xpos, ypos; // Starting position of the ball
boolean firstContact = false; // Whether we've heard from the microcontroller
String serialString;

void setup() {
size(256, 256); // Stage size
noStroke(); // No border on the next thing drawn

// Set the starting position of the ball (middle of the stage)
xpos = width/2;
ypos = height/2;

// Print a list of the serial ports, for debugging purposes:
println(Serial.list());

// I know that the first port in the serial list on my mac
// is always my Keyspan adaptor, so I open Serial.list()[0].
// On Windows machines, this generally opens COM1.
// Open whatever port is the one you're using.
port = new Serial(this, Serial.list()[2], 9600);
port.write("\r0B1401\r"); // Send a capital A to start the microcontroller sending
}

void draw() {
background(bgcolor);
fill(fgcolor);
// Draw the shape
ellipse(xpos, ypos, 20, 20);
// Get any new serial data
while (port.available() > 0) {
serialEvent();
}

}

void serialEvent() {
// Add the latest byte from the serial port to array:
char inByte = (char)port.read();

if (inByte == 13 ) {
println(serialString);

// clear the string when we're done:
serialString = "";
} else {
// until we get the carriage return,
// add the latest byte from the serial port
//to the string to be parsed:
serialString += inByte;
}
}

Our next step is to further experiment with the design of the antenna by calculating the inductance, which will help determine how many "coils" to add. Also, we need to figure out how to design the interface to read multiple tags, and only discriminate a single tag when it's taken off the shelf (there is no software application).

Flash Application, link here.