Clear effect pixels on onSetPixel

This commit is contained in:
Juergen Jung 2017-02-16 20:51:48 +01:00
parent eb90a99acd
commit 939bc687ef
1 changed files with 2 additions and 1 deletions

View File

@ -42,6 +42,8 @@ void getRGBValues(uint32_t *rgbBuffer,uint32_t const color){
bool onSetPixel(const HomieRange& range, const String& value){ bool onSetPixel(const HomieRange& range, const String& value){
if(!range.isRange){ if(!range.isRange){
effect = "none";
pixels.clear();
for(int i=0;i<pixels.numPixels();i++){ for(int i=0;i<pixels.numPixels();i++){
pixels.setPixelColor(i, value.toInt()); pixels.setPixelColor(i, value.toInt());
} }
@ -107,7 +109,6 @@ void loopHandler() {
if(lastCall + wait < millis()){ if(lastCall + wait < millis()){
state++; state++;
} }
break; break;
case 1: case 1:
for(int i = 0; i < pixels.numPixels()-EyeSize-2; i++) { for(int i = 0; i < pixels.numPixels()-EyeSize-2; i++) {