Light Sculpture Architecture: Sample Displays

Home

Current Objective: Creating Sample Displays

Requirements

  1. Ensure you understand each step before moving on.
  2. Write code for each step as you go.
  3. Cleanly format your code.
  4. Test your code at the end of each page.

Creating Sample Displays

Copy the following to test your fading:


// these are samples and should be modified or deleted for your show
void runLightShow() {
  int fastTime = 300;
  int midTime = 800;
  int slowTime = 1500;
  int repeatCount = 5;

  ebbAndFlow(fastTime);
  blinkInPairs(slowTime, repeatCount);
}

void ebbAndFlow(int fadeTime) {
  for (byte index = 0; index < sizeof(sampleAcrossArray); index++) {
    byte pin = sampleAcrossArray[index];
    fadeUp(pin, fadeTime);
  }

  for (int index = sizeof(sampleAcrossArray) - 1; index >= 0; index--) {
    byte pin = sampleAcrossArray[index];
    fadeDown(pin, fadeTime);
  }
}

void blinkInPairs(int fadeTime, int repeatCount) {
  for (int count = 0; count < repeatCount; count++) {
    for (byte index = 0; index < sizeof(sampleLeftArray); index++) {
      byte ledPair[] = {sampleLeftArray[index], sampleRightArray[index]};
      fadeUpArray(ledPair, sizeof(ledPair), fadeTime);
    }

    for (int index = sizeof(sampleLeftArray) - 1; index >= 0; index--) {
      byte ledPair[] = {sampleLeftArray[index], sampleRightArray[index]};
      fadeDownArray(ledPair, sizeof(ledPair), fadeTime);
    }

    fadeTime /= 2; // double the speed for the next run
  }
}
                

Make Your Light Show

  1. Create your show using arrays and functions.
  2. Include at least five "acts" or displays for your show.
  3. Test that the knob controls your show speed.
  4. Test that your show looks good at various speeds.

Make sure you test your code!

Back