Forum

Vvvv draws geometric forms in a 15x20 sparkplug matrix via RS232 (arduino?)

normal edu: [07.11.06 10:53 ](07.11.06 10:53 )

Hi, I`m trying to control a matrix of 15x20 sparkplugs and draw some geometric forms on it via RS232,
is it possible to scan the renderer pixel info and send it to RS232
pixel by pixel? only on/off
or do it all with numerical data and generate circles, lines, etc?
i´ve been trying with spreads, but its no working,
thanks
lalo

Edit

normal West: [07.11.06 11:54 ](07.11.06 11:54 )

You might want to start a new post about your specific Q.

Not sure how you want to control 15 * 20 pixels direct on an RS232, but with some additional hardware it should work. Please post some links, as I am scratching the micro electronics surface.

What kind off info are you sending to the leds?? (only ON and OFF aka 0 and 1) or are we talking RGB here??

I/we have build (and controlled) a 60 x 6 RGB LEDwall, but that was controlled via DMX.

Just post a small example on how you control your LED array.

Hi,
thanks West,
actually, they are not leds, they are sparkplugs!
we may control it with an arduino and some high voltage relays, it´s been not easy at all.
I´m sending an example with processing, it scans the renderer window pixel by pixel with

for(int i=0; i <= matrix.width; i++){
for(int e=0; e<= matrix.height; e++){
micolor = matrix.get(i,e);
if(micolor == color(255)){
uno = 1;} else{
uno=0;}

println(i+ “,” + e + " " + uno);

and yes, this is only on/off (1/0),
that is what we need, scan the rendererDX9 (width 15- height 20) and if lightness = 1, send (a, b)= 1, else (a, b)=0,

what do you think?..
thanks!

this is the processing code:

///////////////////////////////////////////
color micolor;
PGraphics matrix;
int uno;

void setup(){
size(150,200,P3D);
matrix = createGraphics(15,20,P3D);
frameRate(4);
}

void draw(){
background(0,0,0);

matrix.beginDraw();
matrix.background(0,0,0);

matrix.stroke(255);
matrix.line(7,9,random(3),3);
matrix.line(7,9,random(3)+6,0);
matrix.line(7,9,random(3)+11,3);
matrix.line(7,9,random(3),15);
matrix.line(7,9,random(3)+6,20);
matrix.line(7,9,random(3)+11,15);

for(int i=0; i <= matrix.width; i++){
for(int e=0; e<= matrix.height; e++){
micolor = matrix.get(i,e);
if(micolor == color(255)){
uno = 1;} else{
uno=0;}

 println(i+ "," + e + " " + uno);

}
}

matrix.endDraw();

image(matrix,0,0,width,height);

//matrix.endDraw();
}

////////////////////////////////////////////////////

15x20a.v4p (4.5 kB)

sorry, something happened with the last post!
i´m sending it again

normal edu: [07.11.06 10:53 ](07.11.06 10:53 )

Hi, I`m trying to control a matrix of 15x20 sparkplugs and draw some geometric forms on it via RS232,
is it possible to scan the renderer pixel info and send it to RS232
pixel by pixel? only on/off
or do it all with numerical data and generate circles, lines, etc?
i´ve been trying with spreads, but its no working,
thanks
lalo

Edit
normal West: [07.11.06 11:54 ](07.11.06 11:54 )

You might want to start a new post about your specific Q.

Not sure how you want to control 15 * 20 pixels direct on an RS232, but with some additional hardware it should work. Please post some links, as I am scratching the micro electronics surface.

What kind off info are you sending to the leds?? (only ON and OFF aka 0 and 1) or are we talking RGB here??

I/we have build (and controlled) a 60 x 6 RGB LEDwall, but that was controlled via DMX.

Just post a small example on how you control your LED array.

Hi,
thanks West,
actually, they are not leds, they are sparkplugs!
we may control it with an arduino and some high voltage relays, it´s been not easy at all.
I´m sending an example with processing, it scans the renderer window pixel by pixel with

for(int i=0; i for(int e=0; e micolor = matrix.get(i,e);
if(micolor == color(255)){
uno = 1;} else{
uno=0;}

println(i+ “,” + e + " " + uno);

and yes, this is only on/off (1/0),
that is what we need, scan the rendererDX9 (width 15- height 20) and if lightness = 1, send (a, b)= 1, else (a, b)=0,

what do you think?..
thanks!

this is the processing code:

///////////////////////////////////////////
color micolor;
PGraphics matrix;
int uno;

void setup(){
size(150,200,P3D);
matrix = createGraphics(15,20,P3D);
frameRate(4);
}

void draw(){
background(0,0,0);

matrix.beginDraw();
matrix.background(0,0,0);

matrix.stroke(255);
matrix.line(7,9,random(3),3);
matrix.line(7,9,random(3)+6,0);
matrix.line(7,9,random(3)+11,3);
matrix.line(7,9,random(3),15);
matrix.line(7,9,random(3)+6,20);
matrix.line(7,9,random(3)+11,15);

for(int i=0; i for(int e=0; e micolor = matrix.get(i,e);
if(micolor == color(255)){
uno = 1;} else{
uno=0;}

 println(i+ "," + e + " " + uno);

}
}

matrix.endDraw();

image(matrix,0,0,width,height);

//matrix.endDraw();
}

////////////////////////////////////////////////////

15x20a.v4p (4.5 kB)

Don’t know processing…

Haha, well, without the hardware sketch, I can’t make anything off what you are trying to do here. (check PM though). I have an Arduino too, looks like a fun project to work on.

First off all, you must see if you can get the Arduino and VVVV to communicate (asume you read the Arduino tutorials here).

And that should be tested with something way simpler than you are doing atm. No worries, if you get simple stuff to work, it is easy to also do something like you showed with your patch.

I think, first thing you need to get a simple, basic 15 * 20 values matrix to burn. (and than we are off for the way cooler animations). So fill up a 300 slices spread with ones and zero’s, put it in a text string and send it over to the arduino. (ehh… easier said than done)

Patched something, but is quite useless, will have to see tommorow how to code the arduino recieving end.

15x20needsleep.v4p (8.9 kB)

the other way (to create a grid out of a renderer) could be look like this. Don´t forget that your Arduino only has 13 outputs. You will need some aditional Hardware like some Shiftregisters to set up a matrix.

convert.v4p (6.2 kB)

That is what I meant, trouble isn’t making cool animations, or getting a render to black/white values, you first need to get it to arduino to the matrix…

hi,
thanks a lot!,
it works fantastic,
we have not tested it with microcontroler(s) yet, but we are doing it today (mexico)
this is a new patch,
thanks again!
lalo

spark1.v4p (15.5 kB)

Sounds very much like a classic Carsten Nicolai installation.

Certainly many of the arduino users would like to see the stuff you did (both in vvvv and arduino) on the {http://www.arduino.cc/playground/Interfacing/VVVV|Arduino Playground Pages…

Yes, I would love to see what you did too!!

How ever, I see one very big error in your patch, an please, correct me if I am wrong.

You have Mapped your 0.5 sec LFO from 0 - 299, how ever, the FRAMERATE off VVVV is NOT 600 Frames/Sec (60 comes first) so if you do it that way, you will for sure miss loads off values that are never send to the arduino. (see ((Timing (Debug) ) node.

That is why I used that 300 caracter long string (only need to fill up an Array off 300 on the Arduino side).

Ow, and don’t forget the gridpick for your patches ;)

GridPickExample.v4p (8.7 kB)

milo wrote:
“Don´t forget that your Arduino only has 13 outputs. You will need some aditional Hardware like some Shiftregisters to set up a matrix.”

This is a link explaining how to control 32 Leds with 8 ports.
May be you can use that. Dont know if that work with relays because it uses PWM.

Hi,
it was impossible
high voltage causes induction and pc crashes,
we don´t have enough time,
so my participation as programmer is over
they will do it with microcontrollers
mh…

thanks a lot for your help!!!
lalo