mirror of
https://github.com/Makuna/NeoPixelBus.git
synced 2025-08-07 21:04:27 +02:00
Updated Spiral Topography (markdown)
@@ -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;
|
||||||
|
Reference in New Issue
Block a user