Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Miller <marmilicious@users.noreply.github.com>2021-04-05 01:59:45 +0300
committerMarc Miller <marmilicious@users.noreply.github.com>2021-04-05 01:59:45 +0300
commit7e070d6489f845688616e9d4822e5df62d6078f5 (patch)
treef88a5df28d31e2eda9a073109347a7fdfa5fa2c2 /examples/Noise/Noise.ino
parentf57fca35cec6f1b3552ad8e12e0c491a92ea58e0 (diff)
matrix x,y indicies changed back to uint8_t
Matrix examples x,y indicies changed back to uint8_t but returned pixel number kept as uint16_t Added "Params for width and height" and "Param for different pixel layouts" comment lines to match other matrix examples. In NoisePlayground changed #define kMatrixWidth to const uint8_t kMatrixWidth to match format in other matrix examples.
Diffstat (limited to 'examples/Noise/Noise.ino')
-rw-r--r--examples/Noise/Noise.ino10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/Noise/Noise.ino b/examples/Noise/Noise.ino
index 9b72aaa8..f11d75d7 100644
--- a/examples/Noise/Noise.ino
+++ b/examples/Noise/Noise.ino
@@ -5,15 +5,17 @@
//
// Params for width and height
-const uint16_t kMatrixWidth = 16;
-const uint16_t kMatrixHeight = 16;
+const uint8_t kMatrixWidth = 16;
+const uint8_t kMatrixHeight = 16;
+
#define MAX_DIMENSION ((kMatrixWidth>kMatrixHeight) ? kMatrixWidth : kMatrixHeight)
#define NUM_LEDS (kMatrixWidth * kMatrixHeight)
+
// Param for different pixel layouts
const bool kMatrixSerpentineLayout = true;
-uint16_t XY( uint16_t x, uint16_t y)
+uint16_t XY( uint8_t x, uint8_t y)
{
uint16_t i;
@@ -24,7 +26,7 @@ uint16_t XY( uint16_t x, uint16_t y)
if( kMatrixSerpentineLayout == true) {
if( y & 0x01) {
// Odd rows run backwards
- uint16_t reverseX = (kMatrixWidth - 1) - x;
+ uint8_t reverseX = (kMatrixWidth - 1) - x;
i = (y * kMatrixWidth) + reverseX;
} else {
// Even rows run forwards