Updated Spiral Topography (markdown)

Michael Miller
2017-01-07 16:52:54 -08:00
parent 6d69011ee8
commit 22a5591700

@@ -27,7 +27,7 @@ uint16_t Map(int16_t ring, int16_t pixel) const
### Mapping Implementation ### Mapping Implementation
To implement the map method, the ring argument and pixel must be translated into the final index value. The first part is to calculate the start of the ring; this can be accomplished by a lookup table using the data above. Then we just need to add the pixel to offset to the correct one. To implement the map method, the ring argument and pixel must be translated into the final index value. The first part is to calculate the start of the ring; this can be accomplished by a lookup table using the data above. Then we just need to add the pixel to offset to the correct one.
``` ```
const uint16_t Rings[] = {0, 1, 7, 19, 35, 59}; const uint16_t Rings[] = {0, 1, 7, 19, 35, 59, 119};
uint16_t Map(int16_t ring, int16_t pixel) const { uint16_t Map(int16_t ring, int16_t pixel) const {
uint16_t index = Rings[ring] + pixel; uint16_t index = Rings[ring] + pixel;