   Serial.begin(115200);
   SPI.begin();  
   allocateMemory();
-  //updateLeds();
+  updateLeds();
 }
 
 /**


// An LED on our light strip
struct LED {
  unsigned int red        = 0;
  unsigned int green      = 0;
  unsigned int blue       = 0;
  unsigned int brightness = 0;
};

// Current LED state

  int endLength = round(((float)(currentLedCount - 1) / 16.0) + 0.5F);
  endLength = max(endLength, 4);
  int i;
  byte headerByte;
  LED *led;
  SPI.beginTransaction(SPISettings(16000000, MSBFIRST, SPI_MODE0));
  // Start by sending 32 zero bits
  for(i = 0 ; i < 4 ; i++) {
    SPI.transfer(0x00);
  }
  // Send each LED state, header is 1110 0000 & 5-bit brightness, then b/g/r color channels
  for(i = 0 ; i < currentLedCount ; i++) {
    led = &leds[i];
    headerByte = B11100000 | led->brightness;
    SPI.transfer(headerByte);
    SPI.transfer(led->blue);
    SPI.transfer(led->green);
    SPI.transfer(led->red);
  }
  for(i = 0 ; i < endLength ; i++) {
    SPI.transfer(0xFF);
  }
  SPI.endTransaction();  
}

void simulateTransfer() {
  // For APA102C
  int endLength = round(((float)(currentLedCount - 1) / 16.0) + 0.5F);
  endLength = max(endLength, 4);
  int i;
  byte headerByte;
  LED *led;
  // Start by sending 32 zero bits
  for(i = 0 ; i < 4 ; i++) {
    printByte(0x00, false);
  }
  Serial.println();
  // Send each LED state, header is 1110 0000 & 5-bit brightness, then b/g/r color channels
  for(i = 0 ; i < currentLedCount ; i++) {
    led = &leds[i];
    headerByte = B11100000 | led->brightness;
    printByte(headerByte, false);
    printByte(led->blue, false);
    printByte(led->green, false);
    printByte(led->red, true);
  }
  for(i = 0 ; i < endLength ; i++) {
    printByte(0xFF, false);
  }
}

void printByte(byte b, boolean newline) {
  for(int i = 7 ; i > -1 ; i--) {
    Serial.print(((b >> i) & B00000001) && 1);
    if(i == 4) {
      Serial.print(" ");
    }
  }
  Serial.print("   ");
  if(newline) {
    Serial.println();
  }
}

