Skip to content

Commit

Permalink
[P165] Add plugin Display - NeoPixel (7-segment)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonhuisman committed Aug 25, 2024
1 parent 73d6ff7 commit b48416a
Show file tree
Hide file tree
Showing 58 changed files with 7,429 additions and 15 deletions.
8 changes: 7 additions & 1 deletion lib/NeoPixelBus_wrapper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**NeoPixelBus_wrapper**: A minimal wrapper to replace Adafruit_NeoPixel API to use Makuna's NeoPixelBus API.

(c) 2023, Ton Huisman for [ESPEasy](https://github.com/letscontrolit/ESPEasy).
(c) 2023..2024, Ton Huisman for [ESPEasy](https://github.com/letscontrolit/ESPEasy).

### How to use

Expand All @@ -18,6 +18,12 @@
- Currently only supports the most commonly used NeoPixel stripes `NEO_GRB` and `NEO_GRBW`, and the default `NEO_KHZ800` method. (That's all what is used in ESPEasy...)
- When using an ESP8266 and the used GPIO pin is *not* `GPIO2`, you can enable `# define NEOPIXEL_WRAPPER_USE_ADAFRUIT` in `NeoPixelBus_wrapper.h`, but you'll then be using the Adafruit_NeoPixel library again, as that does allow to select the GPIO pin. The `Adafruit_NeoPixel` library then has to be available for compilation!

### Changelog

- 2024-08-04 tonhuisman: Add support for `fill()` method.
- 2024-01-31 tonhuisman: Add use of Adafruit_NeoPixel library for ESP8266 to restore configurable GPIO pin usage.
- 2023-10-29 tonhuisman: Initial version, wrapper for minimal use. Only what's used from Adafruit_NeoPixel to use NeoPixelBus library

### Support

For questions and improvement requests, please use the Github Issues system.
Expand Down
11 changes: 11 additions & 0 deletions lib/NeoPixelBus_wrapper/src/NeoPixelBus_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,16 @@ uint32_t NeoPixelBus_wrapper::getPixelColor(uint16_t n) {
return 0u; // Fall-through value...
}

void NeoPixelBus_wrapper::fill(uint32_t c,
uint16_t first,
uint16_t count) {
if (nullptr != neopixels_grb) {
neopixels_grb->ClearTo(RgbColor((c >> 16) & 0xFF, (c >> 8) & 0xFF, c & 0xFF), first, first + count); // Unfold the Color(r,g,b,w) static
} else
if (nullptr != neopixels_grbw) {
neopixels_grbw->ClearTo(RgbwColor((c >> 16) & 0xFF, (c >> 8) & 0xFF, c & 0xFF, (c >> 24) & 0xFF), first, first + count);
}
}

#endif // ifndef NEOPIXEL_WRAPPER_USE_ADAFRUIT
#endif // ifndef _NEOPIXELBUS_WRAPPER_CPP
4 changes: 4 additions & 0 deletions lib/NeoPixelBus_wrapper/src/NeoPixelBus_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ struct NeoPixelBus_wrapper
return numLEDs;
}

void fill(uint32_t c = 0,
uint16_t first = 0,
uint16_t count = 0);

static uint32_t Color(uint8_t r, uint8_t g, uint8_t b, uint8_t w = 0) {
return static_cast<uint32_t>(w) << 24 |
static_cast<uint32_t>(r) << 16 |
Expand Down
1 change: 1 addition & 0 deletions lib/NoiascaNeopixelDisplay/.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
just to remove write protection for this folder/library
17 changes: 17 additions & 0 deletions lib/NoiascaNeopixelDisplay/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
NoiascaNeopixelDisplay
==========
NoiascaNeopixelDisplay is an [Arduino](http://arduino.cc) library for WS2812 LED display drivers.

Documentation
-------------
-

Download
--------
The lastest binary version of the Library is always available from the
[NoiascaLedControl Release Page]http://werner.rothschopf.net/


Install
-------
Unzip the content to your Arduino Library Folder
57 changes: 57 additions & 0 deletions lib/NoiascaNeopixelDisplay/docs/html/annotated.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added lib/NoiascaNeopixelDisplay/docs/html/bc_s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/NoiascaNeopixelDisplay/docs/html/bdwn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b48416a

Please sign in to comment.