Merge remote-tracking branch 'plugin/LEDEffect-SolidColor/f/monorepo' into f/monorepo

pull/365/head
Gergely Nagy 6 years ago
commit 5f29de7578
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

@ -0,0 +1,33 @@
# Kaleidoscope-LEDEffect-SolidColor
This plugin provides tools to build LED effects that set the entire keyboard to
a single color. For show, and for backlighting purposes.
## Using the extension
To use the plugin, include the header, declare an effect using the
`kaleidoscope::plugin::LEDSolidColor` class, and tell the firmware to use the
new effect:
```c++
#include <Kaleidoscope-LEDEffect-SolidColor.h>
static kaleidoscope::plugin::LEDSolidColor solidRed(160, 0, 0);
KALEIDOSCOPE_INIT_PLUGINS(LEDControl, solidRed);
void setup() {
Kaleidoscope.setup();
}
```
## Dependencies
* [Kaleidoscope-LEDControl](LEDControl.md)
## Upgrading
Previous versions of `LEDEffect-SolidColor` used `kaleidoscope::LEDSolidColor`
as a class for defining solid-color effects. This is called
`kaleidoscope::plugin::LEDSolidColor` now. The old name still works, but is
deprecated, and will be removed by 2019-01-14.

@ -0,0 +1,19 @@
/* Kaleidoscope-LEDEffect-SolidColor - Solid color LED effects for Kaleidoscope.
* Copyright (C) 2017 Keyboard.io, Inc.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "kaleidoscope/plugin/LEDEffect-SolidColor.h"

@ -0,0 +1,36 @@
/* Kaleidoscope-LEDEffect-SolidColor - Solid color LED effects for Kaleidoscope.
* Copyright (C) 2017 Keyboard.io, Inc.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Kaleidoscope-LEDEffect-SolidColor.h"
namespace kaleidoscope {
namespace plugin {
LEDSolidColor::LEDSolidColor(uint8_t r, uint8_t g, uint8_t b) {
this->r = r;
this->g = g;
this->b = b;
}
void LEDSolidColor::onActivate(void) {
::LEDControl.set_all_leds_to(r, g, b);
}
void LEDSolidColor::refreshAt(byte row, byte col) {
::LEDControl.setCrgbAt(row, col, CRGB(r, g, b));
}
}
}

@ -0,0 +1,39 @@
/* Kaleidoscope-LEDEffect-SolidColor - Solid color LED effects for Kaleidoscope.
* Copyright (C) 2017 Keyboard.io, Inc.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "Kaleidoscope-LEDControl.h"
namespace kaleidoscope {
namespace plugin {
class LEDSolidColor : public LEDMode {
public:
LEDSolidColor(uint8_t r, uint8_t g, uint8_t b);
protected:
void onActivate(void) final;
void refreshAt(byte row, byte col) final;
private:
uint8_t r, g, b;
};
}
// Backwards compatibility
typedef plugin::LEDSolidColor LEDSolidColor;
}
Loading…
Cancel
Save