From 9aba7d7ed1b09dcefe30c0ba08752ae9dcd38a7b Mon Sep 17 00:00:00 2001 From: Chris Roat <1053153+chrisroat@users.noreply.github.com> Date: Tue, 18 Aug 2026 14:44:42 -0700 Subject: [PATCH 1/2] LaserTag: fix error in ammo counting --- LaserTag/ammo.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LaserTag/ammo.ino b/LaserTag/ammo.ino index a1c7ce8..67854f9 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,7 @@ void UpdateLights(unsigned long currentMillis) { strip.setPixelColor(i, strip.Color(0, 0, 0)); } } - strip.show(); + strip.show(); } void UpdateAmmo(bool dir, unsigned long currentMillis) { From 9aab7c5b42f9546729e3be288d2ec113431c3af7 Mon Sep 17 00:00:00 2001 From: Chris Roat <1053153+chrisroat@users.noreply.github.com> Date: Tue, 18 Aug 2026 14:51:06 -0700 Subject: [PATCH 2/2] LaserTag: fix pixel/IR interrupt interference The IR library uses interrupts to manage timing of incoming data, while the Neo Pixel library disables interrupts when shipping out data. If an IR message comes while the Neo Pixel is updating the pixels, the IR message is garbled and undecodable. This change skips a pixel update during UpdateLights if an IR message is being read. Since pixel updates are rapid, missing one isn't important or noticeable. All other pixel updates - during setup or a hit - are untouched and should take precedent. --- LaserTag/ammo.ino | 2 ++ LaserTag/lights.ino | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/LaserTag/ammo.ino b/LaserTag/ammo.ino index 67854f9..5fa0571 100644 --- a/LaserTag/ammo.ino +++ b/LaserTag/ammo.ino @@ -349,7 +349,9 @@ void UpdateLights(unsigned long currentMillis) { strip.setPixelColor(i, strip.Color(0, 0, 0)); } } + 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