spark/core-firmware — pull request #303 by m-mcgowan (2014-09-10 23:35:58+00:00)
Title: led change notify

This change addresss #302.

User code can implement a function

```cpp
void onChangeRGBLED(uint8_t r, uint8_t g, uint8_t b) {
// do stuff with the LED values
}
```

Which is called any time the LED changes color (either due to user code calling `RGB.color()` or the system updating the LED, e.g. breathing cyan.)

For example, this could be used to use analogWrite() to set PWM outputs to an external RGB led:

```cpp
void onChangeRGBLED(uint8_t r, uint8_t g, uint8_t b) {
analogWrite(D0, r);
analogWrite(D1, g);
analogWrite(D2, b);
}
```