Home > Uncategorized > Flash Cards exercise – Martin Bach Nielsen

Flash Cards exercise – Martin Bach Nielsen

The two words i drew from the flashcards were “Activity” and “LED”.
So I decided to make the BlinkM respond to activity via visual feedback. The only way to measure activity
available at the time was through mouse input.The movement speed of the mouse in both X and Y is then interpreted as activity by my Processing sketch,
and the BlinkM emits light based on the activity in this fashion:

  • R(activity/25)
  • G(activity/25)
  • B(activity/25)

This results in a slow flashing when the mouse is moved around slowly, and gradually faster as the mouse
speed increases. A demonstration video is shown below. To really see it, I had to dim the ambient light,
which gives fairly poor image quality.

CODE

import thingm.linkm.*;
LinkM linkm;
void setup(){  size(1440, 990, P2D);

linkm = new LinkM();

try{    linkm.open();

}

catch(IOException ioe) {    println(“exception” +ioe);  }}
void draw(){

variableBlink(mouseX, mouseY, pmouseX, pmouseY);
}
void variableBlink(int x, int y, int px, int py) {

int speed = abs(x-px) + abs(y-py);

try{      linkm.fadeToRGB(9, speed/25,speed/25,0);

//linkm.off(9);

}

catch(IOException ioe) {      println(“exception” +ioe);

}

}
void stop(){

try{    linkm.off(9);

}

catch(IOException ioe) {    println(“exception” +ioe);

}

linkm.close();

}

END CODE


Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a comment