From a1fadd9f752f82d726bc467bacfa38504670b8ef Mon Sep 17 00:00:00 2001 From: Aaron Christianson Date: Wed, 30 May 2018 16:05:32 +0200 Subject: [PATCH] added changes suggested in the PR discussion. --- README.md | 12 ++++++++++-- src/Kaleidoscope-LEDEffect-Rainbow.cpp | 4 ++-- src/Kaleidoscope-LEDEffect-Rainbow.h | 4 ++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 13c00172..3afdbfd7 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,16 @@ void setup() { ## Plugin methods The plugin provides two objects: `LEDRainbowEffect`, and `LEDRainbowWaveEffect`, -both of which provide methods to set the delay time (animation speed) -and effect brightness, called `delay` and `brightness` respectively. +both of which provide the following methods: + +### `.brightness(brightness)` + +Sets the LED brightness for the effect. + +### `.update_delay(delay)` + +Sets the number of miliseconds between effect updates. +Smaller number = faster rainbows. ## Dependencies diff --git a/src/Kaleidoscope-LEDEffect-Rainbow.cpp b/src/Kaleidoscope-LEDEffect-Rainbow.cpp index 320dbe67..a8a4f21e 100644 --- a/src/Kaleidoscope-LEDEffect-Rainbow.cpp +++ b/src/Kaleidoscope-LEDEffect-Rainbow.cpp @@ -23,7 +23,7 @@ void LEDRainbowEffect::brightness(byte brightness) { rainbow_value = brightness; } -void LEDRainbowEffect::delay(byte delay) { +void LEDRainbowEffect::update_delay(byte delay) { rainbow_update_delay = delay; } @@ -56,7 +56,7 @@ void LEDRainbowWaveEffect::brightness(byte brightness) { rainbow_value = brightness; } -void LEDRainbowWaveEffect::delay(byte delay) { +void LEDRainbowWaveEffect::updat_delay(byte delay) { rainbow_update_delay = delay; } } diff --git a/src/Kaleidoscope-LEDEffect-Rainbow.h b/src/Kaleidoscope-LEDEffect-Rainbow.h index 0c01c5a8..bd87d998 100644 --- a/src/Kaleidoscope-LEDEffect-Rainbow.h +++ b/src/Kaleidoscope-LEDEffect-Rainbow.h @@ -9,7 +9,7 @@ class LEDRainbowEffect : public LEDMode { LEDRainbowEffect(void) {} void brightness(byte); - void delay(byte); + void update_delay(byte); void update(void) final; private: @@ -29,7 +29,7 @@ class LEDRainbowWaveEffect : public LEDMode { LEDRainbowWaveEffect(void) {} void brightness(byte); - void delay(byte); + void update_delay(byte); void update(void) final; private: