Skip to content

Commit

Permalink
Adding flock key command. Updating some minor things in effects and m…
Browse files Browse the repository at this point in the history
…ain sketch
  • Loading branch information
dcheesman committed Feb 16, 2014
1 parent d1084d2 commit 2fea865
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 24 deletions.
5 changes: 2 additions & 3 deletions Effect.pde
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ class Effect{
// check if the effect should be over
if(millis()>startTime+milliseconds){
return true;
} else {
return false;
}
return false;
}

PGraphics getBuffer(){
return imageBuffer;
}
Expand Down
33 changes: 12 additions & 21 deletions LEDStripController.pde
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import processing.serial.*;
Serial port;

// set the size and configuration of your LEDs (never less that 1 on either)
int cols = 20;
int rows = 8;
int cols = 40;
int rows = 20;
int LEDCount = cols*rows;

// ArrayList to hold the current effects
Expand Down Expand Up @@ -125,38 +125,29 @@ void keyPressed(){
if (key == 's') {
Snow snow = new Snow(9000);
effects.add(snow);
}

if (key == 't') {
} else if (key == 't') {
color c = color(245, 255, 120);
Twinkle twinkle = new Twinkle(3000, c);
effects.add(twinkle);
}

if (key == 'f') {
} else if (key == 'f') {
Flashes flashes = new Flashes(15000);
effects.add(flashes);
}

if (key == 'c') {
} else if (key == 'c') {
CircleBurst circleBurst = new CircleBurst(2000, selectedColor);
effects.add(circleBurst);
}

if (key == 'w') {
} else if (key == 'w') {
Wipe wipe = new Wipe(2000, selectedColor);
effects.add(wipe);
}

if (key == 'p') {
} else if (key == 'p') {
// Modifying steps and zoom produces drastic variation.
Plasma plasma = new Plasma(12000, 35, 200, 200, 8);
effects.add(plasma);
}

if (key == 'l') {
} else if (key == 'l') {
GameOfLife gameOfLife = new GameOfLife(3000, selectedColor);
effects.add(gameOfLife);
} else if (key == 'v'){
Flock flock = new Flock(4000, selectedColor);
effects.add(flock);
}

}
Expand All @@ -167,4 +158,4 @@ void mousePressed(){
selectedColor = c;
}
println(selectedColor);
}
}

0 comments on commit 2fea865

Please sign in to comment.