Updated Spiral Topography (markdown)

Michael Miller
2017-01-08 10:15:09 -08:00
parent a74e99e92f
commit fc7fbb535a

@@ -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.