NeoPixel, strip.show() blocking IR remote

Hello!
I’m new at arduino programming but have made a program which reads the time of a RTC and shows time on a 60 LED neoPixel strip. The program uses switch cases that are controlled by an IR remote. I want to be able to switch between a clock, stopwatch etc. The switch case and neoPixel clock works fine, as long as they are working seperately. When combined the IR remote signal sends “random” numbers and is because of that unable recognize buttons and switch case. This problem only occurs, when “strip.show()” is called. I don’t know a workaround, since I’m unable to find information about how strip.show() works and doesn’t have enough knowledge of my own to solve this problem.

Example of problem:

Button “1” in Serial Monitor before strip.show(); :
FF30CF

Button “1” in Serial Monitor after strip.show(); :
72096DD6
69DBBC3C
FEAC02E5
BFBD49E5
DDE32E9D
412D9F2F
Seems totally random…

I hope that some of you are able to help me!
Thanks in advance! (English isn’t my first language :slight_smile: )

SHORT PROGRAM WITH PROBLEM:

I’m using the following libraries:

#include <LiquidCrystal.h>
#include <virtuabotixRTC.h>
#include <Adafruit_NeoPixel.h>
#include <IRremote.h>

Following variables:
virtuabotixRTC myRTC(6, 7, 8);
Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);
int RECV_PIN = 3;
IRrecv irrecv(RECV_PIN);
decode_results results;
int var = 1; // case variable
int bright = 50;
int dim = 2;
uint32_t timeFarve = strip.Color(bright,0,0); //Color of hour
uint32_t baggrundFarve = strip.Color(0,0,dim); //Color of background
uint32_t minutFarve = strip.Color(bright,0,bright); //color of minutes
uint32_t sekundFarve = strip.Color(bright,bright,bright); //color of seconds
uint32_t lilla = strip.Color(bright,0,bright); // purple

Following SETUP:
Serial.begin(9600);
irrecv.enableIRIn();
strip.begin();
strip.show();

Following LOOP:

if (irrecv.decode(&results)) {
Serial.println(results.value, HEX); //print remote signal

// -------------- + --------------
if(results.value == 0xFF30CF)
{
var=2;
}
switch (var)
{

case 1:
{

strip.setPixelColor(myRTC.seconds,baggrundFarve);
strip.show();

}
break;

case 2:
{
Serial.println(“You were able to switch!!”);
}
break;

default:
{
Serial.println(“An error has occured”);
}
break;
}
}

menu.ino (10.3 KB)

This NEC IR library is based on interrupts.
It might be a better marriage than using IRremote.h
However, I haven’t tried it with Adafruit_NeoPixel.h

.

Thank you for a quick response! I will try it out :)