  * Send commands to LED hardware to update lights
  */
 void updateLeds() {
-  // TODO: update LED strip
-}
-
+  // For APA102C
+  int endLength = round(((float)(currentLedCount - 1) / 16.0) + 0.5F);
+  endLength = max(endLength, 4);
+  int i;
+  byte headerByte = B11100000;  
+  LED *led;
+  SPI.beginTransaction(SPISettings(8000000, MSBFIRST, SPI_MODE1));
+  // 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 = headerByte & 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(0x00);
+  }
+  SPI.endTransaction();  
+  Serial.print("Updated LEDs, endlength: ");
+  Serial.println(endLength);
+}
+

// Current # of LEDs this controller is driving
int currentLedCount = DEFAULT_LED_COUNT;

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

// Current LED state

 *  - Updates attached LED strip
 */

#include <SPI.h>

// Default # of LEDs this controller is driving
const int DEFAULT_LED_COUNT = 180;

