Skip to content

Commit

Permalink
GETTING A WORKING ANIMATION. Yay.
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHagerman committed Aug 20, 2016
1 parent 0d43e72 commit ba3bff9
Showing 1 changed file with 23 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public class LightsController implements Runnable {
float goodFFTBuckets[] = new float[STRAND_LENGTH];
float goodFFTLog[] = new float[STRAND_LENGTH];

// DEBUG:
boolean derp = false;

void setup()
{
log.info("SETUP!");
Expand Down Expand Up @@ -129,30 +132,30 @@ public void stop() {
stopping = true;
}

void draw(LightParams p)
{
if (p.isOn()) {
log.trace("Turning lights on");
setAllLights(color(255,255,255));
} else {
log.trace("Turning lights off");
setAllLights(0);
}
void draw(LightParams p) {
globalTime++;

processAudio();
doArt();
// mapDrawingToLights(); // lights[][] -> pixel[]
// Maybe handle LightParams here somehow?
// p

// Set some random pixel to full white:
//int x = (int)random(totalPixels);
//p[x] = 0x00ffffff;
// Light debug:
// if (derp) {
// if (p.isOn()) {
// log.trace("Turning lights on");
// setAllLights(color(255,255,255));
// } else {
// log.trace("Turning lights off");
// setAllLights(0);
// }
// derp = !derp;

// Draw colors from pixel[] to the lights:
drawLEDs(); // draws pixel[] to the LEDs.

// Set the random pixel back to black for the next pass:
//p[x] = 0;
doArt();

// REQUIRED CODE:
mapDrawingToLights(); // lights[][] -> pixel[]
drawLEDs(); // draws pixel[] to the LEDs.
// YUP.
}

void exit()
Expand Down Expand Up @@ -209,7 +212,7 @@ void doArt() {
// colorMode(HSB, 255);
// color theColor = color(roundedVal, 255, 255);

int theColor = Color.HSBtoRGB(i/255, 255/255, 255/255);
int theColor = Color.HSBtoRGB(roundedVal/255.0f, 1.0f, 1.0f);
// color theColor = color(globalTime%255, 255, 255);
// color theColor = color(roundedVal, roundedVal, roundedVal);
// setOneRing(i, theColor);
Expand Down

0 comments on commit ba3bff9

Please sign in to comment.