Skip to content

Commit

Permalink
Merge pull request #52 from keyboardio/f/plugin-v2
Browse files Browse the repository at this point in the history
Updated to use the new plugin APIs
  • Loading branch information
algernon committed May 15, 2018
2 parents dfb3d61 + 033b870 commit c7fab58
Showing 1 changed file with 48 additions and 49 deletions.
97 changes: 48 additions & 49 deletions Model01-Firmware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -279,70 +279,69 @@ void hostPowerManagementEventHandler(kaleidoscope::HostPowerManagement::Event ev
toggleLedsOnSuspendResume(event);
}

/** The 'setup' function is one of the two standard Arduino sketch functions.
* It's called when your keyboard first powers up. This is where you set up
* Kaleidoscope and any plugins.
*/

void setup() {
// First, call Kaleidoscope's internal setup function
Kaleidoscope.setup();
// First, tell Kaleidoscope which plugins you want to use.
// The order can be important. For example, LED effects are
// added in the order they're listed here.
KALEIDOSCOPE_INIT_PLUGINS(
// The boot greeting effect pulses the LED button for 10 seconds after the keyboard is first connected
BootGreetingEffect,

// Next, tell Kaleidoscope which plugins you want to use.
// The order can be important. For example, LED effects are
// added in the order they're listed here.
Kaleidoscope.use(
// The boot greeting effect pulses the LED button for 10 seconds after the keyboard is first connected
&BootGreetingEffect,
// The hardware test mode, which can be invoked by tapping Prog, LED and the left Fn button at the same time.
TestMode,

// The hardware test mode, which can be invoked by tapping Prog, LED and the left Fn button at the same time.
&TestMode,
// LEDControl provides support for other LED modes
LEDControl,

// LEDControl provides support for other LED modes
&LEDControl,
// We start with the LED effect that turns off all the LEDs.
LEDOff,

// We start with the LED effect that turns off all the LEDs.
&LEDOff,
// The rainbow effect changes the color of all of the keyboard's keys at the same time
// running through all the colors of the rainbow.
LEDRainbowEffect,

// The rainbow effect changes the color of all of the keyboard's keys at the same time
// running through all the colors of the rainbow.
&LEDRainbowEffect,
// The rainbow wave effect lights up your keyboard with all the colors of a rainbow
// and slowly moves the rainbow across your keyboard
LEDRainbowWaveEffect,

// The rainbow wave effect lights up your keyboard with all the colors of a rainbow
// and slowly moves the rainbow across your keyboard
&LEDRainbowWaveEffect,
// The chase effect follows the adventure of a blue pixel which chases a red pixel across
// your keyboard. Spoiler: the blue pixel never catches the red pixel
LEDChaseEffect,

// The chase effect follows the adventure of a blue pixel which chases a red pixel across
// your keyboard. Spoiler: the blue pixel never catches the red pixel
&LEDChaseEffect,
// These static effects turn your keyboard's LEDs a variety of colors
solidRed, solidOrange, solidYellow, solidGreen, solidBlue, solidIndigo, solidViolet,

// These static effects turn your keyboard's LEDs a variety of colors
&solidRed, &solidOrange, &solidYellow, &solidGreen, &solidBlue, &solidIndigo, &solidViolet,
// The breathe effect slowly pulses all of the LEDs on your keyboard
LEDBreatheEffect,

// The breathe effect slowly pulses all of the LEDs on your keyboard
&LEDBreatheEffect,
// The AlphaSquare effect prints each character you type, using your
// keyboard's LEDs as a display
AlphaSquareEffect,

// The AlphaSquare effect prints each character you type, using your
// keyboard's LEDs as a display
&AlphaSquareEffect,
// The stalker effect lights up the keys you've pressed recently
StalkerEffect,

// The stalker effect lights up the keys you've pressed recently
&StalkerEffect,
// The numpad plugin is responsible for lighting up the 'numpad' mode
// with a custom LED effect
NumPad,

// The numpad plugin is responsible for lighting up the 'numpad' mode
// with a custom LED effect
&NumPad,
// The macros plugin adds support for macros
Macros,

// The macros plugin adds support for macros
&Macros,
// The MouseKeys plugin lets you add keys to your keymap which move the mouse.
MouseKeys,

// The MouseKeys plugin lets you add keys to your keymap which move the mouse.
&MouseKeys,
// The HostPowerManagement plugin enables waking up the host from suspend,
// and allows us to turn LEDs off when it goes to sleep.
HostPowerManagement
);

// The HostPowerManagement plugin enables waking up the host from suspend,
// and allows us to turn LEDs off when it goes to sleep.
&HostPowerManagement
);
/** The 'setup' function is one of the two standard Arduino sketch functions.
* It's called when your keyboard first powers up. This is where you set up
* Kaleidoscope and any plugins.
*/
void setup() {
// First, call Kaleidoscope's internal setup function
Kaleidoscope.setup();

// While we hope to improve this in the future, the NumPad plugin
// needs to be explicitly told which keymap layer is your numpad layer
Expand Down

0 comments on commit c7fab58

Please sign in to comment.