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-04 05:31:24 +0300
committerMarc Miller <marmilicious@users.noreply.github.com>2021-04-04 05:31:24 +0300
commitf57fca35cec6f1b3552ad8e12e0c491a92ea58e0 (patch)
treed8578925348758de1a9879c6ced803413a705927 /examples/Noise/Noise.ino
parentb5874b588ade1d2639925e4e9719fa7d3c9d9e94 (diff)
Some Modernization updates for #1208
As suggested in #1208 this updates: LEDS.[function] to FastLED.[function] Switch from byte to uint8_t Use uint16_t for all LED index variables Remove messages about minimum version
Diffstat (limited to 'examples/Noise/Noise.ino')
-rw-r--r--examples/Noise/Noise.ino16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/Noise/Noise.ino b/examples/Noise/Noise.ino
index b0635702..9b72aaa8 100644
--- a/examples/Noise/Noise.ino
+++ b/examples/Noise/Noise.ino
@@ -5,15 +5,15 @@
//
// Params for width and height
-const uint8_t kMatrixWidth = 16;
-const uint8_t kMatrixHeight = 16;
+const uint16_t kMatrixWidth = 16;
+const uint16_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( uint8_t x, uint8_t y)
+uint16_t XY( uint16_t x, uint16_t y)
{
uint16_t i;
@@ -24,7 +24,7 @@ uint16_t XY( uint8_t x, uint8_t y)
if( kMatrixSerpentineLayout == true) {
if( y & 0x01) {
// Odd rows run backwards
- uint8_t reverseX = (kMatrixWidth - 1) - x;
+ uint16_t reverseX = (kMatrixWidth - 1) - x;
i = (y * kMatrixWidth) + reverseX;
} else {
// Even rows run forwards
@@ -62,15 +62,15 @@ uint16_t speed = 20; // a nice starting speed, mixes well with a scale of 100
uint16_t scale = 311;
// This is the array that we keep our computed noise values in
-uint8_t noise[MAX_DIMENSION][MAX_DIMENSION];
+uint16_t noise[MAX_DIMENSION][MAX_DIMENSION];
void setup() {
// uncomment the following lines if you want to see FPS count information
// Serial.begin(38400);
// Serial.println("resetting!");
delay(3000);
- LEDS.addLeds<WS2811,2,RGB>(leds,NUM_LEDS);
- LEDS.setBrightness(96);
+ FastLED.addLeds<WS2811,2,RGB>(leds,NUM_LEDS);
+ FastLED.setBrightness(96);
// Initialize our coordinates to some random values
x = random16();
@@ -107,6 +107,6 @@ void loop() {
}
ihue+=1;
- LEDS.show();
+ FastLED.show();
// delay(10);
}