diff --git a/LaserTag/ammo.ino b/LaserTag/ammo.ino index a1c7ce8..5fa0571 100644 --- a/LaserTag/ammo.ino +++ b/LaserTag/ammo.ino @@ -322,7 +322,7 @@ uint8_t Blue(uint32_t color) void UpdateLights(unsigned long currentMillis) { for (int i = 0; i < strip.numPixels(); i++) { - if (i < LED_COUNT){ //ammo) { + if (i < ammo) { uint8_t r; uint8_t g; uint8_t b; @@ -349,7 +349,9 @@ void UpdateLights(unsigned long currentMillis) { strip.setPixelColor(i, strip.Color(0, 0, 0)); } } - strip.show(); + if (IrReceiver.isIdle()) { + strip.show(); + } } void UpdateAmmo(bool dir, unsigned long currentMillis) { diff --git a/LaserTag/lights.ino b/LaserTag/lights.ino index 3b033ce..4d4d9d3 100644 --- a/LaserTag/lights.ino +++ b/LaserTag/lights.ino @@ -307,7 +307,9 @@ void UpdateLights(unsigned long currentMillis) { strip.setPixelColor(i, strip.Color(0, 0, 0)); } } - strip.show(); + if (IrReceiver.isIdle()) { + strip.show(); + } } #pragma endregion UI_FUNTIONS