Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

led change notify #303

Merged
merged 0 commits into from
Sep 11, 2014
Merged

led change notify #303

merged 0 commits into from
Sep 11, 2014

Conversation

m-mcgowan
Copy link
Contributor

This change addressses #302.

User code can implement a function

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:

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

@m-mcgowan
Copy link
Contributor Author

Refactored this and included for 0.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant