my version of the RGBLed library. NOTHING changed, just wanted to put into my account.
Fork of RGBLed by
RGBLed Class Reference
A light RGB LED Class
Warning : This library is for non-PWN LED
Here is an quick hello-world class that makes the LED blink with all colors.
More...
#include <RGBLed.h>
Data Structures | |
| class | Color |
| RGB Color class Colors have been defined and are ready to use in RGBLed class. More... | |
Public Member Functions | |
| RGBLed (PinName redPin, PinName greenPin, PinName bluePin) | |
| Create a RGBLed, containing the informations about the LED pinout. | |
| void | setColor (RGBLed::Color &color) |
| Change the color of the LED. | |
Static Public Attributes | |
| static Color | BLACK = RGBLed::Color(1,1,1) |
| Black Color (no color) | |
| static Color | RED = RGBLed::Color(0,1,1) |
| Red Color. | |
| static Color | GREEN = RGBLed::Color(1,0,1) |
| Green Color. | |
| static Color | BLUE = RGBLed::Color(1,1,0) |
| Blue Color. | |
| static Color | MAGENTA = RGBLed::Color(0,1,0) |
| Magenta Color (Red + Blue) | |
| static Color | CYAN = RGBLed::Color(1,0,0) |
| Cyan Color (Green + Blue) | |
| static Color | YELLOW = RGBLed::Color(0,0,1) |
| Yellow Color (Red + Green) | |
| static Color | WHITE = RGBLed::Color(0,0,0) |
| White Color (Red + Green + Blue) | |
Detailed Description
A light RGB LED Class
Warning : This library is for non-PWN LED
Here is an quick hello-world class that makes the LED blink with all colors.
#include "mbed.h" #include "RGBLed.h" //was -> #include "rgb.h" RGBLed led(LED_RED, LED_GREEN, LED_BLUE); int main() { RGBLed::Color list[8] = {RGBLed::BLACK, RGBLed::RED, RGBLed::GREEN, RGBLed::BLUE, RGBLed::MAGENTA, RGBLed::CYAN, RGBLed::YELLOW, RGBLed::WHITE}; int i = 0; while (true) { i = (i+1)%8; led.setColor(list[i]); wait_ms(100); } }
Definition at line 47 of file RGBLed.h.
Constructor & Destructor Documentation
| RGBLed | ( | PinName | redPin, |
| PinName | greenPin, | ||
| PinName | bluePin | ||
| ) |
Create a RGBLed, containing the informations about the LED pinout.
- Parameters:
-
redPin the pin linked to the Red LED greenPin the pin linked to the green LED blue the pin linked to the blue LED
Definition at line 25 of file RGBLed.cpp.
Member Function Documentation
| void setColor | ( | RGBLed::Color & | color ) |
Change the color of the LED.
- Parameters:
-
color the color to display
- See also:
- RGBLed::Color
Definition at line 29 of file RGBLed.cpp.
Field Documentation
RGBLed::Color BLACK = RGBLed::Color(1,1,1) [static] |
RGBLed::Color BLUE = RGBLed::Color(1,1,0) [static] |
RGBLed::Color CYAN = RGBLed::Color(1,0,0) [static] |
RGBLed::Color GREEN = RGBLed::Color(1,0,1) [static] |
RGBLed::Color MAGENTA = RGBLed::Color(0,1,0) [static] |
RGBLed::Color RED = RGBLed::Color(0,1,1) [static] |
RGBLed::Color WHITE = RGBLed::Color(0,0,0) [static] |
RGBLed::Color YELLOW = RGBLed::Color(0,0,1) [static] |
Generated on Tue Jul 12 2022 21:47:52 by
1.7.2
