Processing
September 13, 2009 at 6:56 pm Leave a comment
Someone recently suggested integrating the BlipBox with Processing. The Processing language is:
an open source programming language and environment for people who want to program images, animation, and interactions.
This was such an excellent idea that we simply had to do it. And now the beta version of the BlipBox Processing (or p5 if you prefer) library is ready!
Here’s an example of a very simple Processing sketch that talks two-ways with a BlipBox:
ProcessingBlipBox blipbox;
int x = 0;
int y = 0;
int value = 255;
void setup(){
blipbox = new ProcessingBlipBox(this);
}
void draw(){
blipbox.setLed(x, y, value);
if(++x == 10){
x = 0;
if(++y == 8 )
y = 0;
}
if(blipbox.isScreenPressed())
value = blipbox.getX(0, 255);
// scales X position to 0-255 range
delay(20);
}
For this to work, the blipbox.jar library has to be added to the sketch using the PDE (Processing Development Environment).
What the sketch does is the following:
It iterates over all LEDs by column and row, setting them to an initial value of 255 (maximum luminosity).
If at any point the touch screen is pressed, then the value is changed to reflect the horizontal position of the touch.
The library code is currently in CVS and will be part of the first BlipBox public release, so that everyone can sketch with the ‘box!
Updated: here’s a silly little video to show y’all it’s for real:
Entry filed under: BlipBox, News and Updates. Tags: .
Trackback this post | Subscribe to the comments via RSS Feed