Add LED class #7
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.