From fe479f89d901cd8ad59969429757c597ae1e17bc Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Tue, 22 Mar 2016 17:05:41 -0700 Subject: [PATCH] Created NeoTiles object (markdown) --- NeoTiles-object.md | 66 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 NeoTiles-object.md diff --git a/NeoTiles-object.md b/NeoTiles-object.md new file mode 100644 index 0000000..b5855d6 --- /dev/null +++ b/NeoTiles-object.md @@ -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 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 strip(PixelCount, PixelPin); +NeoTiles 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 \ 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 \ 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 \ 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 +``` \ No newline at end of file