mirror of
https://github.com/Makuna/NeoPixelBus.git
synced 2025-08-07 12:54:26 +02:00
Updated Spiral Topography (markdown)
@@ -52,7 +52,7 @@ uint16_t Map(uint16_t ring, uint16_t pixel) const {
|
||||
return index;
|
||||
}
|
||||
```
|
||||
NOTE: The code above `(sizeof(Rings)/sizeof(Rings[0])` is a way of having the compiler calculate the count of elements in the Rings array without us hardcoding anything. Often this is exposed as `_countof()` in many code based but it was not included in the Arduino headers for some reason.
|
||||
NOTE: The code above `(sizeof(Rings)/sizeof(Rings[0])` is a way of having the compiler calculate the count of elements in the Rings array without us hardcoding anything. Often this is exposed as `_countof()` in many code bases but it was not included in the Arduino headers for some reason.
|
||||
|
||||
### Making the object usable for different collections of rings
|
||||
The above code hard codes the array of values. We can make this a configuration argument to the constructor of our mapping class and thus reuse the code for different projects.
|
||||
|
Reference in New Issue
Block a user