From d73104de7f5fe0a786b56b04745b4b9da9676269 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Fri, 27 Jan 2017 09:37:29 +0100 Subject: [PATCH] Updated to use Keyboardio-LEDControl Signed-off-by: Gergely Nagy --- examples/LED-Stalker/LED-Stalker.ino | 2 +- src/Akela/LED-Stalker.cpp | 4 ++-- src/Akela/LED-Stalker.h | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/LED-Stalker/LED-Stalker.ino b/examples/LED-Stalker/LED-Stalker.ino index c4fb6df5..aa276ea0 100644 --- a/examples/LED-Stalker/LED-Stalker.ino +++ b/examples/LED-Stalker/LED-Stalker.ino @@ -43,7 +43,7 @@ void setup () { Keyboardio.setup (KEYMAP_SIZE); StalkerEffect.configure (STALKER (BlazingTrail, NULL)); - Keyboardio.use (&StalkerEffect, NULL); + Keyboardio.use (&LEDControl, &StalkerEffect, NULL); } void loop () { diff --git a/src/Akela/LED-Stalker.cpp b/src/Akela/LED-Stalker.cpp index c119c147..f89c9678 100644 --- a/src/Akela/LED-Stalker.cpp +++ b/src/Akela/LED-Stalker.cpp @@ -59,7 +59,7 @@ namespace Akela { for (byte r = 0; r < ROWS; r++) { for (byte c = 0; c < COLS; c++) { if (map[r][c]) - led_set_crgb_at (r, c, colorComputer->compute (map[r][c])); + LEDControl.led_set_crgb_at (r, c, colorComputer->compute (map[r][c])); bool wasZero = (map[r][c] == 0); @@ -73,7 +73,7 @@ namespace Akela { map[r][c] = 0; if (!wasZero && !map[r][c]) - led_set_crgb_at (r, c, (cRGB){0, 0, 0}); + LEDControl.led_set_crgb_at (r, c, (cRGB){0, 0, 0}); } } } diff --git a/src/Akela/LED-Stalker.h b/src/Akela/LED-Stalker.h index 75fc3137..74b5d75b 100644 --- a/src/Akela/LED-Stalker.h +++ b/src/Akela/LED-Stalker.h @@ -17,6 +17,7 @@ */ #include +#include #define STALKER(n, ...) (({static Akela::LEDEffects::Stalker::n _effect (__VA_ARGS__); &_effect;}))