added methods to control delay time and updated the README

pull/365/head
Aaron Christianson 7 years ago
parent 48927e5ccf
commit e6f7aef63b

@ -25,18 +25,22 @@ both!) of the effects:
#include <Kaleidoscope-LEDControl.h>
#include <Kaleidoscope-LEDEffect-Rainbow.h>
KALEIDOSCOPE_INIT_PLUGINS(LEDRainbowEffect, LEDRainbowWaveEffect);
void setup() {
Kaleidoscope.setup();
Kaleidoscope.use(&LEDRainbowWaveEffect, &LEDDigitalRainEffect);
LEDRainbowEffect.brightness(150);
LEDRainbowWaveEffect.brightness(150);
LEDRainbowWaveEffect.delay(50);
}
```
## Plugin methods
The plugin provides two objects: `LEDRainbowEffect`, and `LEDRainbowWaveEffect`,
neither of which have any public methods or properties, outside of those
provided by all LED modes.
both of which provide methods to set the delay time (animation speed)
and effect brightness, called `delay` and `brightness` respectively.
## Dependencies

@ -23,6 +23,10 @@ void LEDRainbowEffect::brightness(byte brightness) {
rainbow_value = brightness;
}
void LEDRainbowEffect::delay(byte delay) {
rainbow_update_delay = delay;
}
// ---------
@ -51,6 +55,10 @@ void LEDRainbowWaveEffect::update(void) {
void LEDRainbowWaveEffect::brightness(byte brightness) {
rainbow_value = brightness;
}
void LEDRainbowWaveEffect::delay(byte delay) {
rainbow_update_delay = delay;
}
}
kaleidoscope::LEDRainbowEffect LEDRainbowEffect;

@ -9,6 +9,7 @@ class LEDRainbowEffect : public LEDMode {
LEDRainbowEffect(void) {}
void brightness(byte);
void delay(byte);
void update(void) final;
private:
@ -28,6 +29,7 @@ class LEDRainbowWaveEffect : public LEDMode {
LEDRainbowWaveEffect(void) {}
void brightness(byte);
void delay(byte);
void update(void) final;
private:

Loading…
Cancel
Save