mirror of
https://github.com/Makuna/NeoPixelBus.git
synced 2025-08-07 04:44:26 +02:00
Created NeoTiles object (markdown)
66
NeoTiles-object.md
Normal file
66
NeoTiles-object.md
Normal file
@@ -0,0 +1,66 @@
|
||||
The NeoTiles object is constructed with two layout "methods" that provide the mapping from the 2d coordinate system to index that the NeoPixelBus requires.
|
||||
```
|
||||
template <typename T_MATRIX_LAYOUT, typename T_TILE_LAYOUT> class NeoTiles
|
||||
```
|
||||
The T_MATRIX_LAYOUT will define how the pixels on an individual matrix panel are laid out.
|
||||
The T_TILE_LAYOUT will define how the matrix panels are laid out in the bigger tile arrangement.
|
||||
|
||||
This object has the restriction that all the panels within the collections use the same layout and the same orientation. The NeoMosaic object 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);
|
||||
NeoTiles <RowMajorAlternatingLayout, ColumnMajorAlternatingLayout> tiles(
|
||||
PanelWidth,
|
||||
PanelHeight,
|
||||
TileWidth,
|
||||
TileHeight);
|
||||
|
||||
...
|
||||
strip.SetPixelColor(tiles.Map(4, 5), RgbColor(16,16,98));
|
||||
tiles.Map(x, y)
|
||||
```
|
||||
|
||||
Using the NeoPixelsTilesDump.ino sample, the following are some example layouts.
|
||||
|
||||
#### NeoTiles \<RowMajorAlternatingLayout, ColumnMajorAlternatingLayout\> tiles()
|
||||
```
|
||||
0 1 2 3 4 5 6 7
|
||||
-------------------------------------------------------------------
|
||||
0 | 0< 1 2 3 48< 49 50 51
|
||||
1 | 7 6 5 4 55 54 53 52
|
||||
2 | 8 9 10 11 56 57 58 59
|
||||
3 | 15> 14 13 12 63> 62 61 60
|
||||
4 | 16< 17 18 19 32< 33 34 35
|
||||
5 | 23 22 21 20 39 38 37 36
|
||||
6 | 24 25 26 27 40 41 42 43
|
||||
7 | 31> 30 29 28 47> 46 45 44
|
||||
```
|
||||
|
||||
#### NeoTiles \<RowMajorAlternatingLayout, RowMajorAlternatingLayout\> tiles()
|
||||
```
|
||||
0 1 2 3 4 5 6 7
|
||||
-------------------------------------------------------------------
|
||||
0 | 0< 1 2 3 16< 17 18 19
|
||||
1 | 7 6 5 4 23 22 21 20
|
||||
2 | 8 9 10 11 24 25 26 27
|
||||
3 | 15> 14 13 12 31> 30 29 28
|
||||
4 | 48< 49 50 51 32< 33 34 35
|
||||
5 | 55 54 53 52 39 38 37 36
|
||||
6 | 56 57 58 59 40 41 42 43
|
||||
7 | 63> 62 61 60 47> 46 45 44
|
||||
```
|
||||
|
||||
#### NeoTiles \<ColumnMajorAlternatingLayout, ColumnMajorLayout\> tiles()
|
||||
```
|
||||
0 1 2 3 4 5 6 7
|
||||
-------------------------------------------------------------------
|
||||
0 | 0< 7 8 15> 32< 39 40 47>
|
||||
1 | 1 6 9 14 33 38 41 46
|
||||
2 | 2 5 10 13 34 37 42 45
|
||||
3 | 3 4 11 12 35 36 43 44
|
||||
4 | 16< 23 24 31> 48< 55 56 63>
|
||||
5 | 17 22 25 30 49 54 57 62
|
||||
6 | 18 21 26 29 50 53 58 61
|
||||
7 | 19 20 27 28 51 52 59 60
|
||||
```
|
Reference in New Issue
Block a user