Robert Carpenter

robert@tumblerlock.io — Boulder, Colorado

Color Shade Pendulum

Written: August, 2012

Abstract: An Arduino programmed for a kinetic sculpture made out of a series of pendulums of varying lengths designed to simulate a murmuration of starlings, to be installed at Burning Man 2012.

Compiling Status: unknown

Full Repository: on github

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
    void setup(){
      /* ...snip...
       * pin initialization
       */
      tick = 0;
      algorithm_pick = 0;
      last_algorithm_advance = millis();

      // preload a light switching algorithm
      fxn = &rainbow;
    }

    void loop(){
      switch_algorithms();
      increment_algorithm();
      update_lights();
      delay(DELAY);
    }


    void switch_algorithms(){
      if (next_algorithm) {
        /* snip ...
         * constraining counters
         */
        switch (algorithm_pick) {
          case 0: fxn = &rainbow; break;
          case 1: fxn = &pink; break;
          case 2: fxn = &unified_rainbow; break;
          case 3: fxn = &static_rainbow; break;
          case 4: fxn = &achromatic; break;

          // red blinking means something broke...
          default: fxn = &red_blink; break;
        }
      }
    }

    void increment_algorithm(){
      tick += INCREMENT;

      for (int i=0; i<NUM_LIGHTS; i++)
        (*fxn)(lights[i], i, tick);
    }

    // tell the lights to iterate the rainbow
    void rainbow(Light * light, int position, unsigned long tick){
      int hue = (tick + (30 * position)) % 360;
      light->color.set_hsb( hue, 100, 100);
    }

    // tell the lights to blink red
    void red_blink(Light * light, int position, unsigned long tick){
      int bright = tick % 100 > 50 ? 100 : 0;
      light->color.set_hsb( 1, 100, bright);
    }