Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Multi_WS2811 by
LedStrip Class Reference
Generic LED Strip Pure virtual parent class for all types of LED strip. More...
#include <LedStrip.h>
Inherited by WS2811.
Public Member Functions | |
| LedStrip (uint16_t pixelCount) | |
| Create an LED strip. | |
| virtual void | begin (void)=0 |
| Initialise the LED strip. | |
| virtual void | show (void)=0 |
| Apply the new LED strip values. | |
| virtual void | blank (void)=0 |
| Blank the LED strip. | |
| uint16_t | numPixels () |
| Number of RGB pixels. | |
| uint16_t | numPixelBytes () |
| Number of bytes used for pixel colour data. | |
| uint32_t | total_luminance () |
| Total brightness of all diodes Use to check power budget. | |
| void | setPixelB (uint16_t pixNum, uint8_t blue) |
| Set Blue level of pixel. | |
| void | setPixelG (uint16_t pixNum, uint8_t green) |
| Set Green level of pixel. | |
| void | setPixelR (uint16_t pixNum, uint8_t red) |
| Set Red level of pixel. | |
| void | setPixelColor (uint16_t pixNum, uint32_t color) |
| Set color of pixel. | |
| void | setPixelColor (uint16_t pixNum, uint8_t red, uint8_t green, uint8_t blue) |
| Set color of pixel. | |
| void | setPackedPixels (uint8_t *buffer, uint32_t count) |
| Set color of all pixels. | |
Static Public Member Functions | |
| static uint32_t | Color (uint8_t red, uint8_t green, uint8_t blue) |
| Pack RGB Color data. | |
Detailed Description
Generic LED Strip Pure virtual parent class for all types of LED strip.
Definition at line 19 of file LedStrip.h.
Constructor & Destructor Documentation
| LedStrip | ( | uint16_t | pixelCount ) |
Create an LED strip.
- Parameters:
-
pixelCount Number of RGB LEDs on the strip
Definition at line 3 of file LedStrip.cpp.
Member Function Documentation
| virtual void begin | ( | void | ) | [pure virtual] |
Initialise the LED strip.
Implemented in WS2811.
| virtual void blank | ( | void | ) | [pure virtual] |
Blank the LED strip.
Implemented in WS2811.
| uint32_t Color | ( | uint8_t | red, |
| uint8_t | green, | ||
| uint8_t | blue | ||
| ) | [static] |
Pack RGB Color data.
- Parameters:
-
red Amount of Red green Amount of Green blue Amount of Blue
- Returns:
- Packed RGB color data for one pixel
Definition at line 28 of file LedStrip.cpp.
| uint16_t numPixelBytes | ( | ) |
Number of bytes used for pixel colour data.
Definition at line 48 of file LedStrip.h.
| uint16_t numPixels | ( | ) |
Number of RGB pixels.
Definition at line 44 of file LedStrip.h.
| void setPackedPixels | ( | uint8_t * | buffer, |
| uint32_t | count | ||
| ) |
Set color of all pixels.
- Parameters:
-
*buffer Packed pixel data count Number of pixels
Definition at line 64 of file LedStrip.cpp.
| void setPixelB | ( | uint16_t | pixNum, |
| uint8_t | blue | ||
| ) |
Set Blue level of pixel.
- Parameters:
-
pixNum Pixel Number blue Amount of Blue
Definition at line 57 of file LedStrip.cpp.
| void setPixelColor | ( | uint16_t | pixNum, |
| uint8_t | red, | ||
| uint8_t | green, | ||
| uint8_t | blue | ||
| ) |
Set color of pixel.
- Parameters:
-
pixNum Pixel Number red Amount of Red green Amount of Green blue Amount of Blue
Definition at line 34 of file LedStrip.cpp.
| void setPixelColor | ( | uint16_t | pixNum, |
| uint32_t | color | ||
| ) |
Set color of pixel.
- Parameters:
-
pixNum Pixel Number color Packed RGB color data
Definition at line 70 of file LedStrip.cpp.
| void setPixelG | ( | uint16_t | pixNum, |
| uint8_t | green | ||
| ) |
Set Green level of pixel.
- Parameters:
-
pixNum Pixel Number green Amount of Green
Definition at line 50 of file LedStrip.cpp.
| void setPixelR | ( | uint16_t | pixNum, |
| uint8_t | red | ||
| ) |
Set Red level of pixel.
- Parameters:
-
pixNum Pixel Number red Amount of Red
Definition at line 43 of file LedStrip.cpp.
| virtual void show | ( | void | ) | [pure virtual] |
Apply the new LED strip values.
Implemented in WS2811.
| uint32_t total_luminance | ( | ) |
Total brightness of all diodes
Use to check power budget.
- Returns:
- Sum total of all diodes (red + green + blue)
Definition at line 18 of file LedStrip.cpp.
Generated on Thu Jul 14 2022 14:43:43 by
1.7.2
