From e35cce7b62f9e0f1f2a246e8746310f511c8dc84 Mon Sep 17 00:00:00 2001 From: Tobias Blum Date: Sat, 25 Nov 2017 22:35:59 +0100 Subject: [PATCH] Performance improvement as proposed in issue #57 https://github.com/toblum/McLighting/issues/57 --- Arduino/McLighting/request_handlers.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Arduino/McLighting/request_handlers.h b/Arduino/McLighting/request_handlers.h index 3011842..2bfeee3 100644 --- a/Arduino/McLighting/request_handlers.h +++ b/Arduino/McLighting/request_handlers.h @@ -80,10 +80,7 @@ void handleSetSingleLED(uint8_t * mypayload, uint8_t firstChar = 1) { ledstates[led].blue = ((rgb >> 0) & 0xFF); DBG_OUTPUT_PORT.printf("WS: Set single led [%u] to [%u] [%u] [%u] (%s)!\n", led, ledstates[led].red, ledstates[led].green, ledstates[led].blue, mypayload); - for (uint8_t i = 0; i < strip.numPixels(); i++) { - strip.setPixelColor(i, ledstates[i].red, ledstates[i].green, ledstates[i].blue); - //DBG_OUTPUT_PORT.printf("[%u]--[%u] [%u] [%u] [%u] LED index!\n", rgb, i, ledstates[i].red, ledstates[i].green, ledstates[i].blue); - } + strip.setPixelColor(led, ledstates[led].red, ledstates[led].green, ledstates[led].blue); strip.show(); } exit_func = true;