Skip to content

Instantly share code, notes, and snippets.

@kerinin
Created December 7, 2012 18:51
Show Gist options
  • Save kerinin/4235479 to your computer and use it in GitHub Desktop.
Save kerinin/4235479 to your computer and use it in GitHub Desktop.
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