I made a rgb led cube as my first project and added a IR

I made a rgb led cube as my first project and added a IR remote. But im trying to make a led blink on a button press without delays. Any help is greatly appreciated. my code:

#include <IRremote.h>
#include <FastLED.h>
#define LED_PIN 2
#define NUM_LEDS 125
#define LED_TYPE WS2812
#define COLOR_ORDER RGB
#define IR_PEN 11
CRGB leds[NUM_LEDS];

int BRIGHTNESS = 150;

unsigned long Time;
unsigned long currentTime = 0;
int C = 0;

IRrecv IR(IR_PEN);

decode_results Resultaat;

void setup()
{
delay( 3000 ); // power-up safety delay
FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS);
FastLED.setBrightness(BRIGHTNESS);
Serial.begin(9600);
IR.enableIRIn(); // Start IR-receiver

for (int i = 0; i < NUM_LEDS; i++)
{
leds[i] = CRGB::Black;
}
FastLED.show();
}

void loop()
{
if (IR.decode(&Resultaat))
{
// if button 1 is pressed:
if(Resultaat.value == 0xFF30CF || Resultaat.value == 0x9716BE3F)
{

}
delay(100);
IR.resume();

}

// The code below works fine without using the IR remote.
// But i want to blink the button when the button is pressed.
Time = (millis() / 1000) % 60;

if(Time - currentTime >= 1)
{
currentTime = Time;

Blink(C);
C++;
if(C == 3)
  C = 0;

}
}

void Blink(int c)
{
if(c == 0)
{
leds[0] = CRGB :: Black; FastLED.show();
}
if(c == 1)
{
leds[0] = CRGB :: White; FastLED.show();
}
if(c == 2)
{
leds[0] = CRGB :: Red; FastLED.show();
}
}

What about something like this (in main loop):

if (triggered == true) {
EVERY_N_MILLISECONDS(100) {
Blink©;
C++;
if(C == 3) {
C = 0;
triggered = false;
}
}
}

Also, in your setup you could replace:
for (int i = 0; i < NUM_LEDS; i++)
{
leds[i] = CRGB::Black;
}

with:
FastLED.clear(); // clear strip data

thanks a lot. that worked! it will help me out a lot in other code as well

You don’t get any weird flickers when using the remote? I had to switch to APA102 for projects with IR remotes :expressionless:

no not that I know of. Here’s a vid. only problem I have is that when all the leds are on the receiver gets signals even when im not pushing the remote. thats why the bottom left led is blinking. (default case)
missing/deleted image from Google+