diff --git a/examples/LED-AlphaSquare/LED-AlphaSquare.ino b/examples/LED-AlphaSquare/LED-AlphaSquare.ino index a31cc7cb..24cdf9bf 100644 --- a/examples/LED-AlphaSquare/LED-AlphaSquare.ino +++ b/examples/LED-AlphaSquare/LED-AlphaSquare.ino @@ -68,6 +68,24 @@ const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) { } delay (100); } + + LEDControl.set_all_leds_to (0, 0, 0); + LEDControl.led_sync (); + delay (100); + for (uint8_t step = 0; step <= 0xf0; step += 8) { + AlphaSquare.color = { step, step, step }; + AlphaSquare.display (KaleidoscopePlugins::AlphaSquareSymbols::Lambda, 2); + AlphaSquare.display (KaleidoscopePlugins::AlphaSquareSymbols::Lambda, 10); + delay (10); + } + for (uint8_t step = 0xff; step >= 8; step -= 8) { + AlphaSquare.color = { step, step, step }; + AlphaSquare.display (KaleidoscopePlugins::AlphaSquareSymbols::Lambda, 2); + AlphaSquare.display (KaleidoscopePlugins::AlphaSquareSymbols::Lambda, 10); + delay (10); + } + delay (100); + } LEDControl.set_all_leds_to (0, 0, 0); diff --git a/src/Kaleidoscope-LED-AlphaSquare.h b/src/Kaleidoscope-LED-AlphaSquare.h index b9190e23..160d4eb3 100644 --- a/src/Kaleidoscope-LED-AlphaSquare.h +++ b/src/Kaleidoscope-LED-AlphaSquare.h @@ -20,3 +20,4 @@ #include #include +#include diff --git a/src/Kaleidoscope/AlphaSquare-Symbols.h b/src/Kaleidoscope/AlphaSquare-Symbols.h new file mode 100644 index 00000000..52133e27 --- /dev/null +++ b/src/Kaleidoscope/AlphaSquare-Symbols.h @@ -0,0 +1,31 @@ +/* -*- mode: c++ -*- + * Kaleidoscope-LED-AlphaSquare -- 4x4 pixel LED alphabet + * Copyright (C) 2017 Gergely Nagy + * + * 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, either version 3 of the License, or + * (at your option) any later version. + * + * 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 . + */ + +#pragma once + +#include + +namespace KaleidoscopePlugins { + namespace AlphaSquareSymbols { + /* λ */ + static constexpr uint16_t Lambda = SYM4x4(1, 0, 0, 0, + 0, 1, 0, 0, + 0, 1, 1, 0, + 1, 0, 0, 1); + }; +};