From 94e46e3978b9f2bce8f76383ff9a19879b245ad0 Mon Sep 17 00:00:00 2001 From: Mark Kriegsman Date: Sun, 15 Jan 2017 12:56:45 -0500 Subject: Updated scale16 and scale16by8 for AVR when FASTLED_SCALE8_FIXED is 1. scale16(foo,65535) now equals foo. Updated DemoReel100 to stay within range of NUM_LEDS on non-AVR platforms. Fixes #368. --- examples/DemoReel100/DemoReel100.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/DemoReel100/DemoReel100.ino b/examples/DemoReel100/DemoReel100.ino index ffa3a9fd..03534a91 100644 --- a/examples/DemoReel100/DemoReel100.ino +++ b/examples/DemoReel100/DemoReel100.ino @@ -99,7 +99,7 @@ void sinelon() { // a colored dot sweeping back and forth, with fading trails fadeToBlackBy( leds, NUM_LEDS, 20); - int pos = beatsin16(13,0,NUM_LEDS); + int pos = beatsin16( 13, 0, NUM_LEDS-1 ); leds[pos] += CHSV( gHue, 255, 192); } @@ -119,7 +119,7 @@ void juggle() { fadeToBlackBy( leds, NUM_LEDS, 20); byte dothue = 0; for( int i = 0; i < 8; i++) { - leds[beatsin16(i+7,0,NUM_LEDS)] |= CHSV(dothue, 200, 255); + leds[beatsin16( i+7, 0, NUM_LEDS-1 )] |= CHSV(dothue, 200, 255); dothue += 32; } } -- cgit v1.2.3