Skip to content

Conversation

@blhough
Copy link
Member

@blhough blhough commented Dec 25, 2016

Closes #2

This is untested.
I do not have access to an Arduino to run the code on.

This class represents an RGB (red-green-blue) LED. An RGB LED is a light emitting diode that has three channels, one for each color. By varying the brightness of each of the three channels, an RGB LED can create any color.

It will send a voltage to each of three pins to control the brightness of each channel. The constructor should take the three pins as arguments and store them.

void setRGB(int r, int g, int b)
Takes three ints between 0-255 and sets the color accordingly.
void setRGB(float r, float g, float b)
Takes three floats between 0-1 and sets the color accordingly.
void setHSV(float h, float s, float v)
Takes three floats between 0-1. It will need to convert the hue, saturation, and value into red, green, and blue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants