 };
 static fade_thread_config thread_config[NUMBER_OF_THREADS];
 
-static thread_t *fade_threads[NUMBER_OF_THREADS]; 
+static thread_t *fade_threads[NUMBER_OF_THREADS];
 
 // this magic function creates a Thread from heap
 static thread_t *runThread(tfunc_t pf, void *arg) {

#define THREAD_MEMORY 64
// higher numbers will get run first if there's a scheduling conflict
// The highest number is 127
#define THREAD_PRIORITY 20 

// You can make more threads if you want, to control more pins!
#define NUMBER_OF_THREADS 2

// You'll recognize this code from the "fade" demo!
void fade_code(void *config) {
  struct fade_thread_config *cfg = (struct fade_thread_config *)config;

  int led = cfg->pin;
  int fadeAmount = cfg->speed;

  int brightness = 0;
  while(1) {
    analogWrite(led, brightness);    // update the led's brightness

    // move the brightness by fadeAmount toward a brightness limit
    brightness = brightness + fadeAmount;

    // check if the brightness is at the bottom or top of the 0-255 scale
    // if it is, invert the amount we fade by
    if (brightness <= 0 || brightness >= 255) {
      fadeAmount = -fadeAmount;
    }
    // pause for 30 milliseconds, or else the effect is too fast
    delay(30);
  }
