 }
 
 void setOutputColor(byte output, byte red, byte green, byte blue) {
+  // Set the given output to the configured red, green and blue levels.
   output *= 3;
   setDriverPinLevel(output++, red);
   setDriverPinLevel(output++, green);

}

bool readByte(byte &receivedByte, int timeout) {
  long starttime = millis();
  while (!Serial.available())
    if ((millis() - starttime) > timeout)

}

void writeRegister(byte regAddress, byte regData) {
  // Writes register values for the PCA9685 driver
  Wire.beginTransmission(pcaBaseAddress);
  Wire.write(regAddress);
  Wire.write(regData);
  Wire.endTransmission();
}

void setDriverPinLevel(byte pin, byte level) {
  // Sets the 12-bit PWM pin value based on the 8-bit level input.
  int intensity = pgm_read_word_near(gammaCorrected + level);
  Wire.beginTransmission(pcaBaseAddress);
  // Only write OFF registers, skip ON registers.
  // This means all PWM load starts at zero, which is not ideal
  // but will have to do for the moment.
  Wire.write(pcaFirstLedOff + 4 * pin);
  Wire.write(lowByte(intensity));  // OFF_LOW
  Wire.write(highByte(intensity)); // OFF_HIGH
  Wire.endTransmission();
