hello fastled community =) i*m looking for some help because i really don*t know

hello fastled community =)

im looking for some help because i really dont know to progress any further.

i got a basic scetch running fastLED library and IRremote.
i´am able to change the whole strips colours to fixed red blue green…

but how can i:
make effects?
decrease / increase certain colours?
and more fun stuff?

it as Neopixel 144leds/m

#include “FastLED.h”
#include <IRremote.h>
#define NUM_BUTTONS 44 // The remote has 44 buttons

const uint16_t BUTTON_POWER = 0xFF02FD; // i.e. 0x10EFD827
const uint16_t BUTTON_MORELIGHT = 0xFF3AC5;
const uint16_t BUTTON_LESSLIGHT = 0xFFBA45;
const uint16_t BUTTON_PLAY = 0xFF827;
const uint16_t BUTTON_R = 0xFF1AE5;
const uint16_t BUTTON_G = 0xFF9A65;
const uint16_t BUTTON_B = 0xFFA25D;
const uint16_t BUTTON_W = 0xFF22DD;
const uint16_t BUTTON_REDUP = 0xFFF00F;
const uint16_t BUTTON_REDDOWN = 0xFF1AE5;
const uint16_t BUTTON_GREENUP = 0xFF9A65;
const uint16_t BUTTON_GREENDOWN = 0xFFA25D;
const uint16_t BUTTON_BLUEUP = 0XFF22DD;
const uint16_t BUTTON_BLUEDOWN = 0xFF02FD; // i.e. 0x10EFD827

int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
uint16_t lastCode = 0;

// How many leds in your strip?
#define NUM_LEDS 20
#define DATA_PIN 6

// Define the array of leds
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
irrecv.enableIRIn();
}
void loop()
{
if (irrecv.decode(&results))
{
uint16_t resultCode = (results.value & 0xFFFF);
if (resultCode == 0xFFFF)
resultCode = lastCode;
else
lastCode = resultCode;
switch (resultCode)
{
case BUTTON_R:
fill_solid(leds, NUM_LEDS, CRGB::Cyan);
FastLED.show();
break;
case BUTTON_G:
fill_solid(leds, NUM_LEDS, CRGB::Blue);
FastLED.show();
break;
case BUTTON_POWER:
fill_solid(leds, NUM_LEDS, CRGB::Black);
FastLED.show();
break;
}
FastLED.show();
irrecv.resume(); // Receive the next value
}
}

Please see a myriad of other threads here on why you don’t use IR with Neopixels.

Basically, you can’t reliably use an IR controller with Neopixel animations; this is a shortcoming of the Neopixels themselves. They require interrupts to be turned off, which also disables receiving IR codes.

Try using APA102 (“Dotstar”) LEDs instead, as they don’t have this problem.

I wish there were better answers!

(It will work ok if you’re not animating the pixels… only changing them at all after an IR signal is received.)

ok, so i just get a
APA 102 led strip and it can do all the fun stuff and be controlled by a ir remote?

I use the IRremote library and FastLED library with WS2811 LEDs with the clock that I built a while back to my satisfaction.
I find the trick is to flush (simply discard) any received IR data while data is transmitted to the LEDs as that is likely to have been corrupted.
Then I halt all ‘continuous’ LED action and take on the ‘stable’ IR data and then resume only after all valid IR data transmission is completed. You can then modify the sketch and LED animation based on that IR data.

didnt understand much of what u where talking about, but i know its possible now =)

thanks.

Hi @michael_valberg , I am not sure if you commented my answer or another but here’s a link to that clock I built that uses the IRremote and FastLED on a Arduino MEGA…
https://plus.google.com/106626345342202981932/posts/SM62KcSTgon
You can see in the video that I control the clock with a small IR transmitter. Note that the IR receiver is mounted such that it is pointing backwards as normally the IR signal would bounce off the wall behind the clock. In this video, I positioned the clock on the floor and the IR transmitter has a hard time reaching the receiver but still works !

@JP_Roy Hi, I’m working on this issue with the remote control, too. Sorry JP Roy but I do not understand your solution at all, could you post a small example how you fix the issue between FastLED and IRRemote - thanks -

Hi @Bernd_Klein , I will not post the actual code I use as it is very big and most of it would be totally irrelevant to anybody but me as it applies to a very unique clock that I built.
Did you look at the short video on that link…
https://plus.google.com/106626345342202981932/posts/SM62KcSTgon
It show how it works !
Basically, the clock is always running (that is very normal for a clock!) and LEDS are continuously updated. In my loop, at the very beginning I check to see if my IRreceiver got anything with the following line…
if (irrecv.decode(&results)) checkIRcodes();

It does not matter to me if I receive garbage info at this point as I will skip out of the normal loop and enter the checkIRcodes() function that I created.
In that function, I stop all continuous LED update completely and simply wait there until I get valid IR data. Stopping continuous LED updates is necessary to prevent IR data corruption. These are the 2 lines that I use to do this…
irrecv.resume(); // Receive the next value
while (! irrecv.decode(&results)) {} // just sit there waiting for another IR transmitter key press.
When some IR data is received and decoded, you can use that info and update variables etc… etc… I use a specific IR transmitter key press to indicate the end of IR data transmission and exit the checkIRcodes() function and return to the normal loop and clock operation with it’s continuous LED updating
For that part, I use something very similar to the code initially posted by michael Valberg.
I hope this clarifies things for you otherwise do come back with any specific questions.