Merge pull request #6 from ninjaaron/master

added methods to control delay time and updated the README
pull/365/head
Gergely Nagy 7 years ago committed by GitHub
commit bd4e7677e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -29,14 +29,26 @@ KALEIDOSCOPE_INIT_PLUGINS(LEDRainbowEffect, LEDRainbowWaveEffect);
void setup() {
Kaleidoscope.setup();
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 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

@ -23,6 +23,10 @@ void LEDRainbowEffect::brightness(byte brightness) {
rainbow_value = brightness;
}
void LEDRainbowEffect::update_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::updat_delay(byte delay) {
rainbow_update_delay = delay;
}
}
kaleidoscope::LEDRainbowEffect LEDRainbowEffect;

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

Loading…
Cancel
Save