mirror of
https://github.com/Makuna/NeoPixelBus.git
synced 2025-08-07 04:44:26 +02:00
Created NeoMosaic object (markdown)
38
NeoMosaic-object.md
Normal file
38
NeoMosaic-object.md
Normal file
@@ -0,0 +1,38 @@
|
||||
The NeoMosaic object is constructed with one layout "method" that provides the mapping from the 2d coordinate system to index that the NeoPixelBus requires.
|
||||
```
|
||||
template <typename T_LAYOUT> class NeoMosaic
|
||||
```
|
||||
The T_LAYOUT will define how the pixels on an individual matrix panel are laid out. Orientation is ignored.
|
||||
|
||||
The NeoMosaic object will use its own layout for the matrix panels, and it will rotate the panels to shorten the interconnection distance between panels.
|
||||
|
||||
Once you have constructed one, you can then use it map a given x,y to the index and use this set a pixel color.
|
||||
```
|
||||
NeoPixelBus<NeoGrbFeature, Neo800KbpsMethod> strip(PixelCount, PixelPin);
|
||||
NeoMosaic <RowMajorAlternatingLayout> mosaic(
|
||||
PanelWidth,
|
||||
PanelHeight,
|
||||
TileWidth,
|
||||
TileHeight);
|
||||
|
||||
...
|
||||
strip.SetPixelColor(mosaic.Map(4, 5), RgbColor(16,16,98));
|
||||
|
||||
```
|
||||
|
||||
Using the NeoPixelsMosaicDump.ino sample, the following are some example layouts.
|
||||
|
||||
#### NeoMosaic \<ColumnMajorAlternatingLayout\> mosaic()
|
||||
```
|
||||
0 1 2 3 4 5 6 7
|
||||
-------------------------------------------------------------------
|
||||
0 | 0< 7 8 15> 16< 23 24 31>
|
||||
1 | 1 6 9 14 17 22 25 30
|
||||
2 | 2 5 10 13 18 21 26 29
|
||||
3 | 3 4 11 12 19 20 27 28
|
||||
4 | 60 59 52 51 44 43 36 35
|
||||
5 | 61 58 53 50 45 42 37 34
|
||||
6 | 62 57 54 49 46 41 38 33
|
||||
7 | 63> 56 55 48< 47> 40 39 32<
|
||||
|
||||
```
|
Reference in New Issue
Block a user