Την Πέμπτη 25 Φεβρουαρίου και ώρα 12:00 θα γίνει η προπαράδοση των εργασιών.
Η τελική παρουσίαση θα λάβει τη μορφή έκθεσης και θα πραγματοποιηθεί κατόπιν συνενόησης μαζί σας την ίδια μέρα στις 21:00 ή την επόμενη. Προτείνεται ως χώρος παρουσίασης ο χώρος των εικαστικών, εκτός εάν το έργο συνδέεται άμεσα με κάποιο άλλο χώρο του τμήτατος.
Ζητείται, εκτός από το έργο σας τα παρακάτω:
Δημιουργία αφίσας υπό την μορφή flyer, δεν προσδιορίζεται το μέγεθος της αφίσας.
PDF αρχείο στο οποίο θα αναφέρονται τα μέλη της ομάδας, θα περιγράφεται η ιδέα, η τεχνολογία που χρησιμοποίησατε, σκίτσα ή σχέδια για την υποστήριξη της ιδέας, καθώς και εικονογραφημένη τεμκηρίωση του έργου σας.
Ως οδηγό μπορείτε να χρησιμοποιήσετε τον παρακάτω σύνδεσμο στο οποίο παρουσιάζονται αντίστοιχες εργασίες του μεταπτυχιακού τμήματος Adaptite Architecture and Computation (http://www.aac.bartlett.ucl.ac.uk/) της Bartlett του πανεπιστημίου UCL.
PDF [23.5MB] http://www.aac.bartlett.ucl.ac.uk/catalogue/book.pdf
Καλή επιτυχία
Κυριακή 21 Φεβρουαρίου 2010
Τετάρτη 17 Φεβρουαρίου 2010
Harmonic Sequence
Κάναμε ορισμένες αλλαγές στον κώδικα με σκοπό να δημιουργήσουμε νότες και να μπορέσουμε να ελέγξουμε καλύτερα το τελικό αποτέλεσμα. Ο κώδικας είναι:
import processing.opengl.*;
import processing.video.*;
import s373.flob.*;
import ddf.minim.*;
import ddf.minim.signals.*;
Minim minim;
AudioOutput out;
SineWave sine200;
SineWave sine400;
SineWave sine50;
SineWave sine1200;
Capture video;
Flob flob;
ArrayList blobs;
int tresh = 50;
int fade = 50;
int om = 1;
int videores=350;
boolean drawimg=true;
String info="";
PFont font;
int videotex = 3;
int colormode = flob.BLUE;
float fps = 90;
Monoflob mono;
void setup(){
try {
quicktime.QTSession.open();
}
catch (quicktime.QTException qte) {
qte.printStackTrace();
}
size(700,700,OPENGL);
frameRate(fps);
rectMode(CENTER);
video = new Capture(this, videores, videores, (int)fps);
flob = new Flob(this, video, width,height);
flob.setTresh(tresh);
flob.setImage(videotex);
flob.setBlur(0);
flob.setMirror(true,false);
flob.setOm(0);
flob.setOm(1);
flob.setFade(fade);
flob.setMinNumPixels(20);
flob.setMaxNumPixels(500);
flob.setColorMode(colormode);
font = createFont("monaco",9);
textFont(font);
mono = new Monoflob(0,0);
minim = new Minim(this);
out = minim.getLineOut();
sine200 = new SineWave(0, 0, out.sampleRate());
out.enableSignal(sine200);
}
float a0=0;
float b0=0;
void draw(){
if(video.available()) {
video.read();
blobs = flob.calc(flob.binarize(video));
}
if(drawimg)
image(flob.getImage(), 0, 0, width, height);
rectMode(CENTER);
int numblobs = blobs.size();
for(int i = 0; i < numblobs; i++) { ABlob ab = (ABlob)flob.getABlob(i); mono.touch(ab.cx,ab.cy, ab.dimx, ab.dimy); float a=ab.cx; float b=ab.cy; fill (255,0,0); ellipse (a,b,50,50); out.disableSignal(sine200); if (a!=a0 || b!=b0){ sine200 = new SineWave(a, b, out.sampleRate()); out.addSignal(sine200); if ( a > 0 && a < 600) { out.enableSignal(sine200); fill (random(0, 255), random(0, 255), random (0, 255)); rect (0,0,1920,1500); } else { out.disableSignal(sine200); a0=a; b0=b; } mono.render(); fill(255,152,255); rectMode(CORNER); rect(5,5,flob.getPresencef()*width,10); String stats = ""+frameRate+"\nflob.numblobs: "+numblobs+"\nflob.thresh:" +tresh+ "
"\nflob.image: "+videotex+"\nflob.colormode: "+flob.getColorMode()+"\nflob.presence:"+flob.getPresencef();
fill(0,255,0);
text(stats,5,25);
}
void keyPressed(){
if(key=='b')
drawimg^=true;
if (key=='S')
video.settings();
if (key=='s')
saveFrame("monoflob-######.png");
if (key=='i'){
videotex = (videotex+1)%4;
flob.setImage(videotex);
}
if(key=='t'){
tresh--;
flob.setTresh(tresh);
}
if(key=='T'){
tresh++;
flob.setTresh(tresh);
}
if(key=='f'){
fade--;
flob.setFade(fade);
}
if(key=='F'){
fade++;
flob.setFade(fade);
}
if(key=='o'){
om^=1;
flob.setOm(om);
}
if(key=='c'){
colormode=(colormode+1)%5;
flob.setColorMode(colormode);
}
if(key==' ')
flob.setBackground(video);
}
Πέμπτη 4 Φεβρουαρίου 2010
Take control of 12 LEDs.. v2
..το πρόβλημα με τη σειρά λύθηκε..
..το θέμα τώρα είναι μια μικρή καθυστέρηση που νομίζω οτι υπάρχει κατά την εναλλαγή των LEDs..
arduino code:
processing code:
..το θέμα τώρα είναι μια μικρή καθυστέρηση που νομίζω οτι υπάρχει κατά την εναλλαγή των LEDs..
arduino code:
int ledPin2 = 2;
int ledPin3 = 3;
int ledPin4 = 4;
int ledPin5 = 5;
int ledPin6 = 6;
int ledPin7 = 7;
int ledPin8 = 8;
int ledPin9 = 9;
int ledPin10 = 10;
int ledPin11 = 11;
int ledPin12 = 12;
int ledPin13 = 13;
int procByte[11]; //incoming byte
void setup(){
// initialize the serial communication:
// Serial.begin(9600);
Serial.begin(115200);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
pinMode(ledPin4, OUTPUT);
pinMode(ledPin5, OUTPUT);
pinMode(ledPin6, OUTPUT);
pinMode(ledPin7, OUTPUT);
pinMode(ledPin8, OUTPUT);
pinMode(ledPin9, OUTPUT);
pinMode(ledPin10, OUTPUT);
pinMode(ledPin11, OUTPUT);
pinMode(ledPin12, OUTPUT);
pinMode(ledPin13, OUTPUT);
}
void loop() {
// check if data has been sent from the computer:
if (Serial.available()>12) {
for (int i=0; i<12; i++) {
// read each byte
procByte[i] = Serial.read();
if (procByte[i] == 'A'){
digitalWrite(ledPin2, HIGH);
}
else if (procByte[i] == 'a'){
digitalWrite(ledPin2, LOW);
}
if (procByte[i] == 'B'){
digitalWrite(ledPin3, HIGH);
}
else if (procByte[i] == 'b'){
digitalWrite(ledPin3, LOW);
}
if (procByte[i] == 'C'){
digitalWrite(ledPin4, HIGH);
}
else if (procByte[i] == 'c'){
digitalWrite(ledPin4, LOW);
}
if (procByte[i] == 'D'){
digitalWrite(ledPin5, HIGH);
}
else if (procByte[i] == 'd'){
digitalWrite(ledPin5, LOW);
}
if (procByte[i] == 'E'){
digitalWrite(ledPin6, HIGH);
}
else if (procByte[i] == 'e'){
digitalWrite(ledPin6, LOW);
}
if (procByte[i] == 'F'){
digitalWrite(ledPin7, HIGH);
}
else if (procByte[i] == 'f'){
digitalWrite(ledPin7, LOW);
}
if (procByte[i] == 'G'){
digitalWrite(ledPin8, HIGH);
}
else if (procByte[i] == 'g'){
digitalWrite(ledPin8, LOW);
}
if (procByte[i] == 'H'){
digitalWrite(ledPin9, HIGH);
}
else if (procByte[i] == 'h'){
digitalWrite(ledPin9, LOW);
}
if (procByte[i] == 'I'){
digitalWrite(ledPin10, HIGH);
}
else if (procByte[i] == 'i'){
digitalWrite(ledPin10, LOW);
}
if (procByte[i] == 'J'){
digitalWrite(ledPin11, HIGH);
}
else if (procByte[i] == 'j'){
digitalWrite(ledPin11, LOW);
}
if (procByte[i] == 'K'){
digitalWrite(ledPin12, HIGH);
}
else if (procByte[i] == 'k'){
digitalWrite(ledPin12, LOW);
}
if (procByte[i] == 'L'){
digitalWrite(ledPin13, HIGH);
}
else if (procByte[i] == 'l'){
digitalWrite(ledPin13, LOW);
}
}
}
}
processing code:
import processing.serial.*;
Serial port;
void setup() {
size(300, 150);
// port = new Serial(this, "COM15", 9600);
port = new Serial(this, "COM15", 115200);
background(255);
stroke (0);
line (150, 0, 150, 150);
}
void draw() {
if (mouseX <150 ) {
port.write('A'); //first led on
port.write('b'); //this led off
port.write('c');
port.write('d');
port.write('e');
port.write('F');
port.write('g');
port.write('H');
port.write('i');
port.write('j');
port.write('K');
port.write('l');
}
else if (mouseX >150 && mouseX < 300 ) {
port.write('a'); //first led off
port.write('B'); //this led on
port.write('c');
port.write('d');
port.write('e');
port.write('f');
port.write('G');
port.write('h');
port.write('I');
port.write('j');
port.write('k');
port.write('L');
}
}
Τετάρτη 3 Φεβρουαρίου 2010
Take control of 12 LEDs.. v1
..με τον παρακάτω κώδικα, μπορέσαμε να ελέγξουμε τα 12 LEDs από ένα arduino board ένα-ένα σε σειρά, αλλά δεν μπορούμε να καθορίσουμε ποιο LedPin θα είναι το πρώτο της σειράς.. οπότε τη μια φορά που τρέχουμε το ProcessingCode είναι πρώτο στη σειρά το LedPin3 δεύτερο το LedPin4 κτλ.. την άλλη φορά το LedPin8,LedPin9 κτλ..
..γενικά έχουμε δοκιμάσει-καταφέρει να ελέγξουμε μέχρι 3 arduino boards από ένα Pc (ένα-ένα το κάθε LED).. αλλά το πρόβλημα είναι πάλι ο καθορισμός των πρώτων LEDs της κάθε σειράς..
arduino code:
processing code:
..γενικά έχουμε δοκιμάσει-καταφέρει να ελέγξουμε μέχρι 3 arduino boards από ένα Pc (ένα-ένα το κάθε LED).. αλλά το πρόβλημα είναι πάλι ο καθορισμός των πρώτων LEDs της κάθε σειράς..
arduino code:
int ledPin[] = {1,2,3,4,5,6,7,8,9,10,11,12,13};
int procByte[13]; //incoming byte
void setup()
{
// initialize the serial communication:
Serial.begin(9600);
// initialize the ledPin as an output:
for (int i=0; i<13; i++) {
pinMode(ledPin[i], OUTPUT);
}
}
void loop() {
// check if data has been sent from the computer:
if (Serial.available()>13) {
for (int i=0; i<13; i++) {
// read each byte
procByte[i] = Serial.read();
// pass the value to each pin
analogWrite(ledPin[i], procByte[i]);
}
}
}
processing code:
import processing.serial.*;
Serial port;
void setup() {
size(500, 150);
port = new Serial(this, "COM15", 9600);
background(255);
stroke (0);
line (250, 0, 250, 150);
}
void draw() {
if (mouseX <250 ) {
port.write(255); //first (??) ledPin on
port.write(0); //other ledPins off
port.write(0);
port.write(0);
port.write(0);
port.write(0);
port.write(0);
port.write(0);
port.write(0);
port.write(0);
port.write(0);
port.write(0);
port.write(0);
}
else if (mouseX < 500 ) {
port.write(0); //first(??) ledPin off
port.write(255); //this led on
port.write(0);
port.write(0);
port.write(0);
port.write(255); //this led on
port.write(0);
port.write(0);
port.write(0);
port.write(0);
port.write(0);
port.write(0);
port.write(0);
}
}
2ος τρόπος ελέγχου 2d κίνησης με arduino
Εγκαθιστώντας το Python (http://www.python.org/)και τα modules SendKeys kai Serial, στέλνει σήμα το Arduino και ελέγχει τα πλήκτρα του keyboard. Πρέπει το Python να λειτουργεί στο background.
Το δοκιμάσαμε σε ένα παιχνίδι αλλά όπως και με τον προηγούμενο τρόπο λειτουργεί μόνο στο menu και όταν ξεκινά το παιχνίδι παύει να λειτουργεί. Δεν έχουμε βρεί ακόμη την αιτία.
Python code:
Arduino code:
Το δοκιμάσαμε σε ένα παιχνίδι αλλά όπως και με τον προηγούμενο τρόπο λειτουργεί μόνο στο menu και όταν ξεκινά το παιχνίδι παύει να λειτουργεί. Δεν έχουμε βρεί ακόμη την αιτία.
Python code:
import serial
import SendKeys
import os
ser = serial.Serial('COM5', 9600)
#os.system('start "C:\Program Files\StepMania\StepMania.exe"')
LButton = False;
RButton = False;
UButton = False;
DButton = False;
BButton = False;
SButton = False;
while 1:
x=ser.read()
if x == 'l':
LButton = not LButton
if LButton:SendKeys.key_down(39)
else: SendKeys.key_up(39)
elif x == 'r':
RButton = not RButton
if RButton:SendKeys.key_down(37)
else: SendKeys.key_up(37)
elif x == 'u':
UButton = not UButton
if UButton:SendKeys.key_down(40)
else: SendKeys.key_up(40)
elif x == 'd':
DButton = not DButton
if DButton:SendKeys.key_down(38)
else: SendKeys.key_up(38)
elif x == 's':
SButton = not SButton
if SButton:SendKeys.key_down(13)
else: SendKeys.key_up(13)
elif x == 'b':
BButton = not BButton
if BButton:SendKeys.key_down(8)
else: SendKeys.key_up(8)
else:
pass
ser.close()
Arduino code:
const int leftpin = 2;
const int rightpin = 3;
const int uppin = 5;
const int downpin = 4;
const int backpin = 6;
const int startpin = 7;
byte leftButton = LOW;
byte rightButton = LOW;
byte upButton = LOW;
byte downButton = LOW;
byte backButton = LOW;
byte startButton = LOW;
byte buttonRead = LOW;
void setup()
{
pinMode(leftpin, INPUT);
pinMode(rightpin, INPUT);
pinMode(uppin, INPUT);
pinMode(downpin, INPUT);
pinMode(backpin, INPUT);
pinMode(startpin, INPUT);
Serial.begin(9600);
}
void loop()
{
buttonRead = digitalRead(leftpin);
if(buttonRead != leftButton)
{
leftButton = buttonRead;
Serial.print('l');
}
buttonRead = digitalRead(rightpin);
if(buttonRead != rightButton)
{
rightButton = buttonRead;
Serial.print('r');
}
buttonRead = digitalRead(uppin);
if(buttonRead != upButton)
{
upButton = buttonRead;
Serial.print('u');
}
buttonRead = digitalRead(downpin);
if(buttonRead != downButton)
{
downButton = buttonRead;
Serial.print('d');
}
buttonRead = digitalRead(startpin);
if(buttonRead != startButton)
{
startButton = buttonRead;
Serial.print('s');
}
buttonRead = digitalRead(backpin);
if(buttonRead != backButton)
{
backButton = buttonRead;
Serial.print('b');
}
delay(10); // allow some time for the Serial data to be sent
}
Κυριακή 31 Ιανουαρίου 2010
Keyboard keys pou doulevei
Δουλεύει σε όλες τις εφαρμογές εκτός από το Google earth. Δεν μπορούμε να κινήσουμε την γη. Στο Notepad που το δοκιμάσσαμε όμως μπορουμε να κάνουμε Enter και να κινηθούμε μέσα στο κείμενο με τα βελάκια.
const int buttonPin = 7; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
Serial.begin(9600);
Serial.println("#S|NOTEPAD|[]#");
}
void loop()
{
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is NOT pressed.
// if it is, the buttonState is LOW:
if (buttonState == LOW) {
// turn LED on:
digitalWrite(ledPin, HIGH);
delay(100);
Serial.println("#S|SENDK|[0&{ENTER}]#");
delay(100);
}
else {
// turn LED off:
digitalWrite(ledPin,LOW);
}
}
Σάββατο 30 Ιανουαρίου 2010
Debouncing
Ξαναγράψαμε τον κώδικα με debouncing αλλά αυτήν την φορά το LED δεν αντιδρά με το pushbutton και όταν ανοίγουμε το Notepad κάνει μια φορά Enter αυτόματα και σταματάει. Το pushbutton δεν το επηρεάζει καθόλου. Έχουμε δοκιμάσει να βάλουμε το Serial.println("#S|SENDK|[0&{ENTER}]#"); κάτω και από το άλλο if και να αλλάξουμε και τις τιμές HIGH και LOW καταλήγοντας είτε να στένει συνεχώς εντολές είτε καθόλου, αλλά ποτέ μέσω του pushbutton.
const int buttonPin = 7; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
// variables will change:
int oldButtonState = LOW;
int ButtonState;
// variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
Serial.begin(9600);
Serial.println("#S|NOTEPAD|[]#");
}
void loop()
{
int newButtonState = digitalRead(buttonPin);
if(newButtonState !=oldButtonState)
{
if (ButtonState == HIGH)
{
// turn LED on:
digitalWrite(ledPin, HIGH);
}
else
{
// turn LED off:
digitalWrite(ledPin, LOW);
delay(10);
Serial.println("#S|SENDK|[0&{ENTER}]#");
delay(10);
}
}
{
oldButtonState = newButtonState;
}
Gobetwino
Με την εντολή Serial.println("#S|NOTEPAD|[]#"); στο void setup καταφέραμε να ανοίξουμε το notepad. Μετά επιχειρήσαμε να αλλάξουμε σειρά στον κέρσορα δίνοντας την εντολή ENTER sto push button Serial.println("#S|SENDK|[0&{ENTER}]#");
Δυστυχώς είτε δεν κάνει καθόλου istixos Enter ή θα κάνει συνεχόμενα και με το που πατάμε το pushbutton σταματά. ( αυτό αλλάζει ανάλογα μετά από ποιό if βάζουμε το Serial.println("#S|SENDK|[0&{ENTER}]#"); )
Δυστυχώς είτε δεν κάνει καθόλου istixos Enter ή θα κάνει συνεχόμενα και με το που πατάμε το pushbutton σταματά. ( αυτό αλλάζει ανάλογα μετά από ποιό if βάζουμε το Serial.println("#S|SENDK|[0&{ENTER}]#"); )
const int buttonPin = 7; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup()
{
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
Serial.begin(9600);
Serial.println("#S|NOTEPAD|[]#");
}
void loop()
{
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH)
{
// turn LED on:
digitalWrite(ledPin, LOW);
Serial.println("#S|SENDK|[0&{ENTER}]#");
}
else
{
// turn LED off:
digitalWrite(ledPin, HIGH);
}
}
InterBall
Η πρώτη φάση του project μας. Το URL του κώδικα είναι: http://s373.net/code/flob/flob.html
Ο κώδικας που άλλαξε είναι του αρχείου monoflob colormode.
Ο καινούριος κώδικας:
/*
monoflob
(vs. 20090621)
started out as buttons to trigger things, ended up
with a nice fade engine in the buttons due to presence
this works really sweet connected to soundfile banks gains
loosely inspired from the great and simple monome
andré sier
http://s373.net
*/
import processing.opengl.*;
import processing.video.*;
import s373.flob.*;
/// vars
Capture video;
Flob flob;
ArrayList blobs;
/// video params
int tresh = 50;
int fade = 50;//120;
int om = 1;
int videores=350;
boolean drawimg=true;
String info="";
PFont font;
int videotex = 1;//0;
int colormode = flob.BLUE;
float fps = 90;
float xe = random(0, 900);
float ye = random(0, 900);
int r = 50;
Monoflob mono;
void setup(){
//bug 882 processing 1.0.1
try { quicktime.QTSession.open(); }
catch (quicktime.QTException qte) { qte.printStackTrace(); }
size(900,900,OPENGL);
frameRate(fps);
rectMode(CENTER);
video = new Capture(this, videores, videores, (int)fps);
flob = new Flob(this, video, width,height);
flob.setTresh(tresh);
flob.setImage(videotex);
flob.setBlur(0);
flob.setMirror(true,false);
flob.setOm(0); //flob.setOm(flob.STATIC_DIFFERENCE);
flob.setOm(1); //flob.setOm(flob.CONTINUOUS_DIFFERENCE);
flob.setFade(fade); //only in continuous difference
flob.setMinNumPixels(20); // smaller blobs
flob.setMaxNumPixels(500); // smaller blobs
flob.setColorMode(colormode);
font = createFont("monaco",9);
textFont(font);
mono = new Monoflob(4,4);
//(20,20);//(10,10);//(3,3);//(5,4);
videotex = (videotex+1)%4;
flob.setImage(videotex);
}
void draw(){
if(video.available()) {
video.read();
blobs = flob.calc(flob.binarize(video));
}
if(drawimg)
image(flob.getImage(), 0, 0, width, height);
// rectMode(CENTER);
// int numblobs = blobs.size();//flob.getNumBlobs();
// for(int i = 0; i < numblobs; i++) {
// ABlob ab = (ABlob)flob.getABlob(i);
// mono.touch(ab.cx,ab.cy, ab.dimx, ab.dimy);
// fill(0,0,255,100);
// rect(ab.cx,ab.cy,ab.dimx,ab.dimy);
// fill(0,255,0,200);
// rect(ab.cx,ab.cy, 5, 5);
// info = ""+ab.id+" "+ab.cx+" "+ab.cy;
// text(info,ab.cx,ab.cy+20);
// }
mono.render();
// stats
// fill(255,152,255);
// rectMode(CORNER);
// rect(5,5,flob.getPresencef()*width,10);
//String stats = ""+frameRate+"\nflob.numblobs: "+numblobs+"\nflob.thresh:" +tresh+
// "
// "\nflob.image: "+videotex+"\nflob.colormode: "+flob.getColorMode()+"\nflob.presence:"+flob.getPresencef();
// fill(0,255,0);
// text(stats,5,25);
fill (255, 0, 0);
noStroke ();
round (xe);
round (ye);
ellipse (xe, ye, r, r);
color white = color (255);
loadPixels();
for (int i = 0; i < width*height; i++) {
if (pixels[i] == white) {
xe = round(random(0,900));
ye = round(random(0,900));
}
}
//updatePixels();
}
void keyPressed(){
if(key=='b')
drawimg^=true;
if (key=='S')
video.settings();
if (key=='s')
saveFrame("monoflob-######.png");
if (key=='i'){
videotex = (videotex+1)%4;
flob.setImage(videotex);
}
if(key=='t'){
tresh--;
flob.setTresh(tresh);
}
if(key=='T'){
tresh++;
flob.setTresh(tresh);
}
if(key=='f'){
fade--;
flob.setFade(fade);
}
if(key=='F'){
fade++;
flob.setFade(fade);
}
if(key=='o'){
om^=1;
flob.setOm(om);
}
if(key=='c'){
colormode=(colormode+1)%5;
flob.setColorMode(colormode);
}
if(key==' ') //space clear flob.background
flob.setBackground(video);
}
Παρασκευή 29 Ιανουαρίου 2010
Using Gobetwino to Control Windows through Arduino
https://sites.google.com/a/divinechildhighschool.org/electronics/Home/Arduino-Lessons/using-gobetwino-to-control-windows-through-arduino
Anoigma programmaton kai ektelesi diatagon sta windows meso Arduino, kataskevazontas entoles sto Godetwino.
Anoigma programmaton kai ektelesi diatagon sta windows meso Arduino, kataskevazontas entoles sto Godetwino.
Κυριακή 24 Ιανουαρίου 2010
ΑΝΑΚΟΙΝΩΣΗ
Την ερχόμενη εβδομάδα θα είμαστε στο Βόλο Παρασκευή και Σάββατο με στόχο να λυθούν τα τεχνικά προβλήματα των projects σας. Μέχρι τότε θα πρέπει να προχωρήσετε όσο μπορείτε. Τυχόν απορίες μπορείτε να τις στείλετε και με email.
Μην ξεχάσετε να αναρτήσετε μέχρι και τη Δευτέρα τη φόρμα παρουσίασης του project.
Μην ξεχάσετε να αναρτήσετε μέχρι και τη Δευτέρα τη φόρμα παρουσίασης του project.
Καλό θα είναι να γίνει και μία καταγραφή των υλικών που θα χρειαστείτε. Μερικά μπορούμε να τα παραγγείλουμε από την Αθήνα και να τα φέρουμε την Παρασκευή. Δεν νομίζω ότι η σχολή μπορεί να συνεισφέρει οικονομικά (έχει ήδη διαθέσει αρκετά), αλλά μπορούμε (εάν προλάβουμε) να ακυρώσουμε μερικά για να καλύψουμε κάποια άλλα.
PROCESSING 3D + xtra
http://processing.org/learning/3d/ - 3D εντολές στο processing
http://processing3d.com - 3D processing και λίγο maya
http://vimeo.com/1444116 - processing 3D web cam
http://www.creativeapplications.net/processing/faceless-void-processing/ - processing 3D web cam
http://www.creativeapplications.net/processing/cop15-identity-processing/ - ΑΝΑΜΝΗΣΤΙΚΟ
http://www.creativeapplications.net/processing/configurator-processing/ - 3D & SOUND
Μην αγνοείτε τα παραδείγματα που έχει ήδη το processing. Ειδικά αυτά με τη σύνδεση με το arduino.
http://processing.org/learning/libraries/
http://processing3d.com - 3D processing και λίγο maya
http://vimeo.com/1444116 - processing 3D web cam
http://www.creativeapplications.net/processing/faceless-void-processing/ - processing 3D web cam
http://www.creativeapplications.net/processing/cop15-identity-processing/ - ΑΝΑΜΝΗΣΤΙΚΟ
http://www.creativeapplications.net/processing/configurator-processing/ - 3D & SOUND
Μην αγνοείτε τα παραδείγματα που έχει ήδη το processing. Ειδικά αυτά με τη σύνδεση με το arduino.
http://processing.org/learning/libraries/
arduino με 8 switches & processing: για Δημήτρη
Βρήκα αυτό το project με 8 διακόπτες και arduino. Δοκίμασε το και ενημέρωσε με εάν βοήθησε καθόλου.
http://webzone.k3.mah.se/projects/arduino-workshop/projects/arduino_meets_processing/instructions/8switches.html
http://webzone.k3.mah.se/projects/arduino-workshop/projects/arduino_meets_processing/instructions/8switches.html
arduino & processing: για παναγιώτη
Δες αυτό το παράδειγμα και πες εάν δουλεύει ή όχι. Λογικά δεν πρέπει να έχεις πρόβλημα. Ενημέρωσε με πως πήγε.
http://arduino.cc/en/Tutorial/PhysicalPixel
http://arduino.cc/en/Tutorial/PhysicalPixel
Δευτέρα 18 Ιανουαρίου 2010
ΠΡΟΒΛΗΜΑ ΜΕ ΕΙΣΑΓΩΓΗ ΣΤΟΙΧΕΙΩΝ ΣΕ ΠΙΝΑΚΑ ΣΤΟ processing
Για να χρησιμοποιησω τα στοιχεια που παιρνω απο το Arduino, πρεπει να τα εισαγω σε εναν πινακα. Εκει βρισκεται το προβλημα. Σε ενα αλλο αρχειο με 3 εισαγωμενα στοιχεια, τα πραγματα δουλευουν σωστα, στο συγκεκριμενο ομως οχι. Με τους ηχους δεν παρουσιαζεται προβλημα.
// processing code
import processing.serial.*;
// Import the Sonia library
import pitaru.sonia_v2_9.*;
// Sample objects for the sounds
Sample box_blue_1;
Sample box_blue_2;
Sample box_blue_3;
Sample box_blue_4;
Sample box_orange_1;
Sample box_orange_2;
Sample box_orange_3;
Sample box_orange_4;
Sample box_green_1;
Sample box_green_2;
Sample box_green_3;
Sample box_green_4;
Sample box_yellow_1;
Sample box_yellow_2;
Sample box_yellow_3;
Sample box_yellow_4;
Sample box_over_analog_1;
Sample box_over_analog_2;
Sample box_over_analog_3;
Sample box_over_analog_4;
Sample box_over_analog_5;
Sample box_over_analog_6;
//vars for arduino's array and sound volume
float blueBox1 = 0;
float bb1=0;
float blueBox2 = 0;
float bb2 =0;
float blueBox3 = 0;
float bb3=0;
float blueBox4 = 0;
float bb4=0;
float orangeBox1 = 0;
float ob1=0;
float orangeBox2 = 0;
float ob2=0;
float orangeBox3 = 0;
float ob3=0;
float orangeBox4 = 0;
float ob4=0;
float greenBox1 = 0;
float gb1=0;
float greenBox2 = 0;
float gb2=0;
float greenBox3 = 0;
float gb3=0;
float greenBox4 = 0;
float gb4=0;
float yellowBox1 = 0;
float yb1=0;
float yellowBox2 = 0;
float yb2=0;
float yellowBox3 = 0;
float yb3=0;
float yellowBox4 = 0;
float yb4=0;
float ab1=0;
float ab2=0;
float ab3=0;
float ab4=0;
float ab5=0;
float ab6=0;
Serial myPort;
void setup() {
Sonia.start(this);
// load sound files
box_blue_1 = new Sample( "boo boo boo.wav" );
box_blue_2 = new Sample( "dj.wav" );
box_blue_3 = new Sample( "gruniara01.wav" );
box_blue_4 = new Sample( "gruniara02.wav" );
box_orange_1 = new Sample( "gruniara03.wav" );
box_orange_2 = new Sample( "gruniara04.wav" );
box_orange_3 = new Sample( "gruniara05.wav" );
box_orange_4 = new Sample( "hight02.wav" );
box_green_1 = new Sample( "low01.wav" );
box_green_2 = new Sample( "phaser01.wav" );
box_green_3 = new Sample( "phaser02.wav" );
box_green_4 = new Sample( "phaser03.wav" );
box_yellow_1 = new Sample( "phaser04.wav" );
box_yellow_2 = new Sample( "trainboom a.wav" );
box_yellow_3 = new Sample( "trainboom b.wav" );
box_yellow_4 = new Sample( "wahwah01.wav" );
box_over_analog_1 = new Sample ("wahwah02.wav");
box_over_analog_2 = new Sample ("wahwah03.wav");
box_over_analog_3 = new Sample ("wahwah04.wav");
box_over_analog_4 = new Sample ("wiuwiu.wav");
box_over_analog_5 = new Sample ("wiuwiu2.wav");
box_over_analog_6 = new Sample ("zbubble01.wav");
// play sound files
box_blue_1.play();
box_blue_2.play();
box_blue_3.play();
box_blue_4.play();
box_orange_1.play();
box_orange_2.play();
box_orange_3.play();
box_orange_4.play();
box_green_1.play();
box_green_2.play();
box_green_3.play();
box_green_4.play();
box_yellow_1.play();
box_yellow_2.play();
box_yellow_3.play();
box_yellow_4.play();
box_over_analog_1.play();
box_over_analog_2.play();
box_over_analog_3.play();
box_over_analog_4.play();
box_over_analog_5.play();
box_over_analog_6.play();
box_blue_1.setVolume(bb1);
box_blue_2.setVolume(bb2);
box_blue_3.setVolume(bb3);
box_blue_4.setVolume(bb4);
box_orange_1.setVolume(ob1);
box_orange_2.setVolume(ob2);
box_orange_3.setVolume(ob3);
box_orange_4.setVolume(ob4);
box_green_1.setVolume(gb1);
box_green_2.setVolume(gb2);
box_green_3.setVolume(gb3);
box_green_4.setVolume(gb4);
box_yellow_1.setVolume(yb1);
box_yellow_2.setVolume(yb2);
box_yellow_3.setVolume(yb3);
box_yellow_4.setVolume(yb4);
box_over_analog_1.setVolume(ab1);
box_over_analog_2.setVolume(ab2);
box_over_analog_3.setVolume(ab3);
box_over_analog_4.setVolume(ab4);
box_over_analog_5.setVolume(ab5);
box_over_analog_6.setVolume(ab6);
// List all the available serial ports
println(Serial.list());
// my usb port is 1
myPort = new Serial(this, Serial.list()[1], 57600);
// don't generate a serialEvent() unless you get a newline character:
myPort.bufferUntil('\n');
box_blue_1.repeat();
box_blue_2.repeat();
box_blue_3.repeat();
box_blue_4.repeat();
box_orange_1.repeat();
box_orange_2.repeat();
box_orange_3.repeat();
box_orange_4.repeat();
box_green_1.repeat();
box_green_2.repeat();
box_green_3.repeat();
box_green_4.repeat();
box_yellow_1.repeat();
box_yellow_2.repeat();
box_yellow_3.repeat();
box_yellow_4.repeat();
box_over_analog_1.repeat();
box_over_analog_2.repeat();
box_over_analog_3.repeat();
box_over_analog_4.repeat();
box_over_analog_5.repeat();
box_over_analog_6.repeat();
}
void draw() {
//not necessary
box_blue_1.setVolume(bb1);
box_blue_2.setVolume(bb2);
box_blue_3.setVolume(bb3);
box_blue_4.setVolume(bb4);
box_orange_1.setVolume(ob1);
box_orange_2.setVolume(ob2);
box_orange_3.setVolume(ob3);
box_orange_4.setVolume(ob4);
box_green_1.setVolume(gb1);
box_green_2.setVolume(gb2);
box_green_3.setVolume(gb3);
box_green_4.setVolume(gb4);
box_yellow_1.setVolume(yb1);
box_yellow_2.setVolume(yb2);
box_yellow_3.setVolume(yb3);
box_yellow_4.setVolume(yb4);
box_over_analog_1.setVolume(ab1);
box_over_analog_2.setVolume(ab2);
box_over_analog_3.setVolume(ab3);
box_over_analog_4.setVolume(ab4);
box_over_analog_5.setVolume(ab5);
box_over_analog_6.setVolume(ab6);
}
void serialEvent(Serial myPort) {
// get the ASCII string:
String inString = myPort.readStringUntil('\n');
if (inString != null) {
// trim off any whitespace:
inString = trim(inString);
// split the string on the commas and convert the
// resulting substrings into an integer array:
float[] boxes = float(split(inString, ",")); // EDW EINAI TO PROVLIMA
// check the results
println(boxes[1]); // DEN VAZEI TA DEDOMENA SE OLES TIS THESEIS TOU PINAKA PARA MONO STO boxes[1] KAI OTAN TIPONO KAPOIO ALLO KARASAREI
// if the array has at least 16 elements, I got
// the whole thing. I put the numbers in the
// boxes variables:
if (boxes.length >=16) {// DEN EKTELEITAI KAN
blueBox1 = boxes[0];
blueBox2 = boxes[1];
blueBox3 = boxes[2];
blueBox4 = boxes[3];
orangeBox1 = boxes[4];
orangeBox2 = boxes[5];
orangeBox3 = boxes[6];
orangeBox4 = boxes[7];
greenBox1 = boxes[8];
greenBox2 = boxes[9];
greenBox3 = boxes[10];
greenBox4 = boxes[11];
yellowBox1 = boxes[12];
yellowBox2 = boxes[13];
yellowBox3 = boxes[14];
yellowBox4 = boxes[15];
// i change the sound volumes
// DIGITAL INPUTS
if (blueBox1==1) {
bb1=1;
}
else {
bb1=0;
}
if (blueBox2==1) {
bb2=1;
}
else {
bb2=0;
}
if (blueBox3==1) {
bb3=1;
}
else {
bb3=0;
}
if (blueBox4==1) {
bb4=1;
}
else {
bb4=0;
}
if (orangeBox1==1) {
ob1=1;
}
else {
ob1=0;
}
if (orangeBox2==1) {
ob2=1;
}
else {
ob2=0;
}
if (orangeBox3==1) {
ob3=1;
}
else {
ob3=0;
}
if (orangeBox4==1) {
ob4=1;
}
else {
ob4=0;
}
if (greenBox1==1) {
gb1=1;
}
else {
gb1=0;
}
if (greenBox2==1) {
gb2=1;
}
else {
gb2=0;
}
//ANALOG INPUTS
if (greenBox3>=1020) {
gb3=1;
}
else {
gb3=0;
}
if (greenBox4>=1020) {
gb4=1;
}
else {
gb4=0;
}
if (yellowBox1>=1020) {
yb1=1;
}
else {
yb1=0;
}
if (yellowBox2>=1020) {
yb2=1;
}
else {
yb2=0;
}
if (yellowBox3>=1020) {
yb3=1;
}
else {
yb3=0;
}
if (yellowBox4>=1020) {
yb4=1;
}
else {
yb4=0;
}
}
}
}
void stop()
{
// i must stop the Sonia Library
Sonia.stop();
super.stop();
}
για τα αρχεια των ηχων επικοινωνειστε με mail.
// processing code
import processing.serial.*;
// Import the Sonia library
import pitaru.sonia_v2_9.*;
// Sample objects for the sounds
Sample box_blue_1;
Sample box_blue_2;
Sample box_blue_3;
Sample box_blue_4;
Sample box_orange_1;
Sample box_orange_2;
Sample box_orange_3;
Sample box_orange_4;
Sample box_green_1;
Sample box_green_2;
Sample box_green_3;
Sample box_green_4;
Sample box_yellow_1;
Sample box_yellow_2;
Sample box_yellow_3;
Sample box_yellow_4;
Sample box_over_analog_1;
Sample box_over_analog_2;
Sample box_over_analog_3;
Sample box_over_analog_4;
Sample box_over_analog_5;
Sample box_over_analog_6;
//vars for arduino's array and sound volume
float blueBox1 = 0;
float bb1=0;
float blueBox2 = 0;
float bb2 =0;
float blueBox3 = 0;
float bb3=0;
float blueBox4 = 0;
float bb4=0;
float orangeBox1 = 0;
float ob1=0;
float orangeBox2 = 0;
float ob2=0;
float orangeBox3 = 0;
float ob3=0;
float orangeBox4 = 0;
float ob4=0;
float greenBox1 = 0;
float gb1=0;
float greenBox2 = 0;
float gb2=0;
float greenBox3 = 0;
float gb3=0;
float greenBox4 = 0;
float gb4=0;
float yellowBox1 = 0;
float yb1=0;
float yellowBox2 = 0;
float yb2=0;
float yellowBox3 = 0;
float yb3=0;
float yellowBox4 = 0;
float yb4=0;
float ab1=0;
float ab2=0;
float ab3=0;
float ab4=0;
float ab5=0;
float ab6=0;
Serial myPort;
void setup() {
Sonia.start(this);
// load sound files
box_blue_1 = new Sample( "boo boo boo.wav" );
box_blue_2 = new Sample( "dj.wav" );
box_blue_3 = new Sample( "gruniara01.wav" );
box_blue_4 = new Sample( "gruniara02.wav" );
box_orange_1 = new Sample( "gruniara03.wav" );
box_orange_2 = new Sample( "gruniara04.wav" );
box_orange_3 = new Sample( "gruniara05.wav" );
box_orange_4 = new Sample( "hight02.wav" );
box_green_1 = new Sample( "low01.wav" );
box_green_2 = new Sample( "phaser01.wav" );
box_green_3 = new Sample( "phaser02.wav" );
box_green_4 = new Sample( "phaser03.wav" );
box_yellow_1 = new Sample( "phaser04.wav" );
box_yellow_2 = new Sample( "trainboom a.wav" );
box_yellow_3 = new Sample( "trainboom b.wav" );
box_yellow_4 = new Sample( "wahwah01.wav" );
box_over_analog_1 = new Sample ("wahwah02.wav");
box_over_analog_2 = new Sample ("wahwah03.wav");
box_over_analog_3 = new Sample ("wahwah04.wav");
box_over_analog_4 = new Sample ("wiuwiu.wav");
box_over_analog_5 = new Sample ("wiuwiu2.wav");
box_over_analog_6 = new Sample ("zbubble01.wav");
// play sound files
box_blue_1.play();
box_blue_2.play();
box_blue_3.play();
box_blue_4.play();
box_orange_1.play();
box_orange_2.play();
box_orange_3.play();
box_orange_4.play();
box_green_1.play();
box_green_2.play();
box_green_3.play();
box_green_4.play();
box_yellow_1.play();
box_yellow_2.play();
box_yellow_3.play();
box_yellow_4.play();
box_over_analog_1.play();
box_over_analog_2.play();
box_over_analog_3.play();
box_over_analog_4.play();
box_over_analog_5.play();
box_over_analog_6.play();
box_blue_1.setVolume(bb1);
box_blue_2.setVolume(bb2);
box_blue_3.setVolume(bb3);
box_blue_4.setVolume(bb4);
box_orange_1.setVolume(ob1);
box_orange_2.setVolume(ob2);
box_orange_3.setVolume(ob3);
box_orange_4.setVolume(ob4);
box_green_1.setVolume(gb1);
box_green_2.setVolume(gb2);
box_green_3.setVolume(gb3);
box_green_4.setVolume(gb4);
box_yellow_1.setVolume(yb1);
box_yellow_2.setVolume(yb2);
box_yellow_3.setVolume(yb3);
box_yellow_4.setVolume(yb4);
box_over_analog_1.setVolume(ab1);
box_over_analog_2.setVolume(ab2);
box_over_analog_3.setVolume(ab3);
box_over_analog_4.setVolume(ab4);
box_over_analog_5.setVolume(ab5);
box_over_analog_6.setVolume(ab6);
// List all the available serial ports
println(Serial.list());
// my usb port is 1
myPort = new Serial(this, Serial.list()[1], 57600);
// don't generate a serialEvent() unless you get a newline character:
myPort.bufferUntil('\n');
box_blue_1.repeat();
box_blue_2.repeat();
box_blue_3.repeat();
box_blue_4.repeat();
box_orange_1.repeat();
box_orange_2.repeat();
box_orange_3.repeat();
box_orange_4.repeat();
box_green_1.repeat();
box_green_2.repeat();
box_green_3.repeat();
box_green_4.repeat();
box_yellow_1.repeat();
box_yellow_2.repeat();
box_yellow_3.repeat();
box_yellow_4.repeat();
box_over_analog_1.repeat();
box_over_analog_2.repeat();
box_over_analog_3.repeat();
box_over_analog_4.repeat();
box_over_analog_5.repeat();
box_over_analog_6.repeat();
}
void draw() {
//not necessary
box_blue_1.setVolume(bb1);
box_blue_2.setVolume(bb2);
box_blue_3.setVolume(bb3);
box_blue_4.setVolume(bb4);
box_orange_1.setVolume(ob1);
box_orange_2.setVolume(ob2);
box_orange_3.setVolume(ob3);
box_orange_4.setVolume(ob4);
box_green_1.setVolume(gb1);
box_green_2.setVolume(gb2);
box_green_3.setVolume(gb3);
box_green_4.setVolume(gb4);
box_yellow_1.setVolume(yb1);
box_yellow_2.setVolume(yb2);
box_yellow_3.setVolume(yb3);
box_yellow_4.setVolume(yb4);
box_over_analog_1.setVolume(ab1);
box_over_analog_2.setVolume(ab2);
box_over_analog_3.setVolume(ab3);
box_over_analog_4.setVolume(ab4);
box_over_analog_5.setVolume(ab5);
box_over_analog_6.setVolume(ab6);
}
void serialEvent(Serial myPort) {
// get the ASCII string:
String inString = myPort.readStringUntil('\n');
if (inString != null) {
// trim off any whitespace:
inString = trim(inString);
// split the string on the commas and convert the
// resulting substrings into an integer array:
float[] boxes = float(split(inString, ",")); // EDW EINAI TO PROVLIMA
// check the results
println(boxes[1]); // DEN VAZEI TA DEDOMENA SE OLES TIS THESEIS TOU PINAKA PARA MONO STO boxes[1] KAI OTAN TIPONO KAPOIO ALLO KARASAREI
// if the array has at least 16 elements, I got
// the whole thing. I put the numbers in the
// boxes variables:
if (boxes.length >=16) {// DEN EKTELEITAI KAN
blueBox1 = boxes[0];
blueBox2 = boxes[1];
blueBox3 = boxes[2];
blueBox4 = boxes[3];
orangeBox1 = boxes[4];
orangeBox2 = boxes[5];
orangeBox3 = boxes[6];
orangeBox4 = boxes[7];
greenBox1 = boxes[8];
greenBox2 = boxes[9];
greenBox3 = boxes[10];
greenBox4 = boxes[11];
yellowBox1 = boxes[12];
yellowBox2 = boxes[13];
yellowBox3 = boxes[14];
yellowBox4 = boxes[15];
// i change the sound volumes
// DIGITAL INPUTS
if (blueBox1==1) {
bb1=1;
}
else {
bb1=0;
}
if (blueBox2==1) {
bb2=1;
}
else {
bb2=0;
}
if (blueBox3==1) {
bb3=1;
}
else {
bb3=0;
}
if (blueBox4==1) {
bb4=1;
}
else {
bb4=0;
}
if (orangeBox1==1) {
ob1=1;
}
else {
ob1=0;
}
if (orangeBox2==1) {
ob2=1;
}
else {
ob2=0;
}
if (orangeBox3==1) {
ob3=1;
}
else {
ob3=0;
}
if (orangeBox4==1) {
ob4=1;
}
else {
ob4=0;
}
if (greenBox1==1) {
gb1=1;
}
else {
gb1=0;
}
if (greenBox2==1) {
gb2=1;
}
else {
gb2=0;
}
//ANALOG INPUTS
if (greenBox3>=1020) {
gb3=1;
}
else {
gb3=0;
}
if (greenBox4>=1020) {
gb4=1;
}
else {
gb4=0;
}
if (yellowBox1>=1020) {
yb1=1;
}
else {
yb1=0;
}
if (yellowBox2>=1020) {
yb2=1;
}
else {
yb2=0;
}
if (yellowBox3>=1020) {
yb3=1;
}
else {
yb3=0;
}
if (yellowBox4>=1020) {
yb4=1;
}
else {
yb4=0;
}
}
}
}
void stop()
{
// i must stop the Sonia Library
Sonia.stop();
super.stop();
}
για τα αρχεια των ηχων επικοινωνειστε με mail.
Τετάρτη 13 Ιανουαρίου 2010
Γεύμα Εργασίας
Καλή Χρονιά σε όλους.
Λέγαμε να συναντηθούμε να φάμε delivery στη σχολή αυτή την πέμπτη 14.01.2010 κατα τις 9:10
Κατα τη διάρκεια του φαγητού σκοπεύουμε να συζητήσουμε και για τα projects του εξαμήνου.
Λέγαμε να συναντηθούμε να φάμε delivery στη σχολή αυτή την πέμπτη 14.01.2010 κατα τις 9:10
Κατα τη διάρκεια του φαγητού σκοπεύουμε να συζητήσουμε και για τα projects του εξαμήνου.
Εγγραφή σε:
Σχόλια (Atom)