Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aligator/neopixelbusgfx
Adafruit_GFX-compatible library for NeoPixelBus library based on Adafruit_NeoMatrix
https://github.com/aligator/neopixelbusgfx
Last synced: 7 days ago
JSON representation
Adafruit_GFX-compatible library for NeoPixelBus library based on Adafruit_NeoMatrix
- Host: GitHub
- URL: https://github.com/aligator/neopixelbusgfx
- Owner: aligator
- License: gpl-3.0
- Created: 2019-11-19T22:08:37.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-30T18:03:29.000Z (over 3 years ago)
- Last Synced: 2024-05-21T05:01:07.368Z (6 months ago)
- Language: C++
- Homepage:
- Size: 146 KB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
NeoPixelBusGfx
===============When I searched for a library to use with the NeoPixel(-compatible) led, I noticed that the original Adafruit_GFX causes some serious flickering on an ESP.
NeoPixelBus instead works great but does not provide the GFX methods Adafruit_GFX provides.That's why I just combined them and created a (nearly) drop-in replacement of Adafruit_GFX which just uses NeoPixelBus to draw the stuff.
That means it supports all led's which NeoPixelBus supports and provides the GFX tools from Adafruit_GFX.But in the background it still uses these libs, so it requires NeoPixelBus and Adafruit_GFX libraries to run.
# Examples in Arduino IDE
After downloading, rename folder to 'NeoPixelBusGfx' and install in Arduino Libraries folder.
To run the examples you need the following dependencies. They should be available in the arduino ide library manager):
* [adafruit/Adafruit GFX Library](https://github.com/adafruit/Adafruit-GFX-Library)
* [makuna/NeoPixelBus](https://github.com/Makuna/NeoPixelBus)
* [adafruit/Adafruit BusIO](https://github.com/adafruit/Adafruit_BusIO)# Use with PlatformIO
Add this to your platformio.ini of your project.
```
lib_deps =
aligator/NeoPixelBusGfx
adafruit/Adafruit GFX Library
makuna/NeoPixelBus
adafruit/Adafruit BusIO
Wire
```If you want to run the examples with PlatformIO, just create a new PlatformIO project and copy the example code into it.
# Usage
The best way to start is to try the matrixtest.
The basic usage is:
* create a matrix instance using either NeoPixelBusGfx or NeoPixelBrightnessBusGfx if you need brightness functionality
```
// See NeoPixelBus documentation for choosing the correct Feature and Method
// (https://github.com/Makuna/NeoPixelBus/wiki/NeoPixelBus-object)
NeoPixelBrightnessBusGfx matrix(WIDTH, HEIGHT, DATA_PIN);
```
* create a topo instance
```
// See NeoPixelBus documentation for choosing the correct NeoTopology
// you may also use NeoTile or NeoMosaik
// (https://github.com/Makuna/NeoPixelBus/wiki/Matrix-Panels-Support)
NeoTopology topo(WIDTH, HEIGHT);
```
* add a small helper function to map the pixels
```
// use a remap function to remap based on the topology, tile or mosaik
// this function is passed as remap function to the matrix
uint16_t remap(uint16_t x, uint16_t y) {
return topo.Map(x, y);
}
```
* and set up the whole thing
```
void setup() {
matrix.Begin();// pass the remap function
matrix.setRemapFunction(&remap);//...
}
```
The remap function is then used to map the pixels to the chosen topography.One side not:
In most cases methods starting with a capital letter are from NeoPixelBus and all other methods are from Adafruit_GFX or the NeoPixelBusGfx lib.