Created
December 7, 2012 18:51
-
-
Save kerinin/4235479 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void set_color(int color, int redPin, int greenPin) | |
{ | |
int centrality = abs(128 - color); | |
int augmentation = floor((128 - centrality) / 5); | |
analogWrite(redPin, color+augmentation); | |
analogWrite(greenPin, 255-color+augmentation); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment