dinsdag 29 september 2009

Programming ftw

Hello there, 

Today we had 2 courses:

Programming for create and Living and Working Tomorrow.

Both given today by Edwin Dertien. And it was fun!

Even homework was fun, programming an avatar (more post in the future about the little guy I'm scripting) and bring along some junk for the next time.


Short post this time, next time I'll tell about the walking animation I'm scripting.

donderdag 24 september 2009

The inner workings of the RFID chair.

Lay back and relax, this post is gonna be a biggie.


Alright, the RFID chair, let me start explaining how and why. 

We used a office chair with a RFID scanner in the left armrest. If you put a tag in your left trouser pocket and lift your leg a little, you'll get scanned. For effect you'll first get a green beam over your face, just for scanning effect.

Here's the code, all the tags, except for mine, have been removed. For privacy reasons.


[code]

import org.onsignal.rfid.*;
import gnu.io.*; // for the exceptions
RFIDReader r;
String portName = "COM4";
RFIDTag tag;
String currentTag;
float offset;
PFont font;
int pos = 0;
int active = 0;
int showtag = 0;
PImage pieter, andre, arthur, douwe, herjan, ineke, irene, jan, jonas, martijn, martina, reinout, sarah, siewart, thomas, tom, bram, joost, unknown;

class TagListener implements RFIDListener
{
void tagAdded(RFIDTagEvent e) {
active = 1;
currentTag=("Tag " + e.getTag() + " was added to reader " + e.getReader());
tag = e.getTag();


}
void tagRemoved(RFIDTagEvent e) {
println("Tag " + e.getTag() + " was removed from reader " + e.getReader());
background(0);

}
}


void setup() {
size(2704,1050);
background(0);
pieter = loadImage("pieter.jpg");
andre = loadImage("Andre.jpg");
arthur = loadImage("Arthur.jpg");
douwe = loadImage("Douwe.jpg");
herjan = loadImage("Herjan.jpg");
ineke = loadImage("Ineke.jpg");
irene = loadImage("Irene.jpg");
jan = loadImage("Jan.jpg");
jonas = loadImage("Jonas.jpg");
martijn = loadImage("Martijn.jpg");
martina = loadImage("Martina.jpg");
reinout = loadImage("Reinout.jpg");
sarah = loadImage("Sarah.jpg");
siewart = loadImage("Siewart.jpg");
thomas = loadImage("Thomas.jpg");
tom = loadImage("Tom.jpg");
unknown = loadImage("unknown.jpg");
joost = loadImage("mudkipz.jpg");
bram = loadImage("riverside.jpg");
try {

r = new RFIDReader(portName, new TagListener());

} catch (NoSuchPortException e) {
println("Port "+portName+" was not found!");
} catch (PortInUseException e) {
println("Port "+portName+" is in use by another program.");
}

}

void draw() {
if (active == 1) {
showtag = 0;
background(0);
pos += 4;
fill(#5BFC00);
//line(1690, pos, 2700, pos);
rectMode(CORNERS);
rect(1690, pos, 2700, pos+10);
if (pos > 800) {
pos = 0;
active = 0;
showtag = 1;
}
}
if (showtag == 1) {
if(tag.equals("fc:62:4c:41")) image(pieter,0,0,1670,1050);
  else if(tag.equals("Tag removed")) image(jan,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(herjan,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(bram,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(irene,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(tom,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(martijn,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(thomas,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(jonas,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(siewart,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(reinout,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(sarah,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(ineke,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(arthur,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(andre,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(martina,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(joost,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(douwe,0,0,1670,1050);
else image(unknown,0,0,1670,1050);

}  
}

[/code]

Let me explain the code: 

Once a cart is scanned, active is set to 1. If active is 1, showtag is 0 (so no image is shown) and it starts the beamer green line output. When it's finished with that it sets active to 0 and showtag to 1. If showtag is 1 it will compare the scanned tag to the known tags and displays the correct image with the registered tags. If the tag is unknown it wil display the unknown user image. 


So, there you have it, an RFID chair!

maandag 21 september 2009

Code is up and running.

Yay! Code is up and running. 


Tomorrow I´ll upload the code.

dinsdag 15 september 2009

new stuff

Got my laserdiode and 2 arduino's! I'm gonna use 1 for the laserprojector, and Jan is going to use the other one for the pongbike. 

maandag 14 september 2009


New laser setup, using 2 mirrors:



RFID progress

I've got the RFID for the  RFID chair/sofa up and running, the code is ready to accept personal immages from everybody. We just gonna need 20 (25 including teachers?) RFID tags. And everyone needs to make a image. This week we're gonna make a template so the images look somewhat the same.

Plans for the laser projector thingy

So, here's an basic idea of the laser projector, a laserdiode shines on a spinning mirror, and a servo can control the height of the projected laser beam.

First post

Hello World, this is my first post, later on i'll most some info about the laser projector I'm building for the smartXP lab