Neopixels not lighting up using IR remote

So I am trying to create a password system with neopixel. Using an ir remote to control each pixel to light up different color depending on the number, beginning from left to right one by one. The problem is, it does not light up at all. What am I doing wrong?

//INFRARED LIBRARY
#include <IRremote.h>
//ADAFRUIT PIXEL LIBRARY
#include <Adafruit_NeoPixel.h>

#define numpixels 8

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(numpixels, 12);

int receiver = 11;


int bryce[8] = {1,1,8,1,1,2,7,7,};
int franchell[8] = {1,1,8,1,2,3,6,2}; 
int justyn[8] = {1,1,8,1,0,6,5,3};
int extra[8] = {1,1,9,8,7,6,5,4};

int x;

//receiver object
IRrecv irrecv(receiver);
//decoder object
decode_results results;

void setup()
{ 
  Serial.begin(9600);
  pixels.begin();
  pixels.show();
  irrecv.enableIRIn();//receiving process
  irrecv.blink13(true);
}

void loop()
{
  //code to know which button corresponds to its HEXAdecimal code
  /*if(irrecv.decode(&results))
  {
    Serial.println(results.value, HEX);
    irrecv.resume();
  }*/
  
  if(irrecv.decode(&results)) //this checks to see if a code has been received
  {
    if(results.value == 0xFD30CF) //if the button press equals the hex value 0xC284
    {
      //maps 0 button
      pixels.setPixelColor(x,pixels.Color(0,0,0));//black
      pixels.show();
    }
    else if(results.value == 0xFD08F7) //if the button press equals the hex value 0xC284
    {
      //maps 1 button
      pixels.setPixelColor(x,pixels.Color(0,0,255));//blue
      pixels.show();
    }
    else if(results.value == 0xFD8877) //if the button press equals the hex value 0xC284
    {
      //maps 2 button
      pixels.setPixelColor(x,pixels.Color(255,165,0));//orange
      pixels.show();
    }
    else if(results.value == 0xFD48B7) //if the button press equals the hex value 0xC284
    {
      //maps 3 button
      pixels.setPixelColor(x,pixels.Color(255,0,0));//red
      pixels.show();
    }
    else if(results.value == 0xFD28D7) //if the button press equals the hex value 0xC284
    {
      //maps 4 button
      pixels.setPixelColor(x,pixels.Color(0,255,0));//green
      pixels.show();
    }
    else if(results.value == 0xFDA857) //if the button press equals the hex value 0xC284
    {
      //maps 5 button
      pixels.setPixelColor(x,pixels.Color(0,255,255));//cyan
      pixels.show();
    }
    else if(results.value == 0xFD6897) //if the button press equals the hex value 0xC284
    {
      //maps 6 button
      pixels.setPixelColor(x,pixels.Color(128,0,128));//purple
      pixels.show();
    }
    else if(results.value == 0xFD18E7) //if the button press equals the hex value 0xC284
    {
      //maps 7 button
      pixels.setPixelColor(x,pixels.Color(255,255,0));//yellow
      pixels.show();
    }
    else if(results.value == 0xFD9867) //if the button press equals the hex value 0xC284
    {
      //maps 8 button
      pixels.setPixelColor(x,pixels.Color(255,0,255));//magenta
      pixels.show();
    }
    else if(results.value == 0xFD58A7) //if the button press equals the hex value 0xC284
    {
      //maps 9 button
      pixels.setPixelColor(x,pixels.Color(255,255,255));//white
      pixels.show();
    }
    irrecv.resume(); //receive the next value
  }
  x++;
}

First thing, try redoing your post using code tags.

Sorry, I'm new in this forum

There are several problems.

Are you really going to supply your light strip from an Arduino Uno and through a breadboard?

Using a fritznuts as a schematic is one problem but that's what we got's to work with.

Are you really going to supply your light strip from an Arduino Uno and through a breadboard?

Next, is that just a IR LED that is connected to the breadboard and not a IR module that has an amp and output thingies? Have you proved, with serial prints, that you are receiving info from the IR thingy?

Next are you really going to supply your light strip from an Arduino Uno and through a breadboard?

Have you tried an example project just to see if the led strip will light?

Are you really going to supply your light strip from an Arduino Uno and through a breadboard?

Let’s see the actual wiring.

Print the received character to confirm the correct code is received.

Thanks guys, i did rewired the strip as you guys have suggested, and I added a delay before the x++ iteration, it works now. Thanks!

Glad you got it working... I wanted to add that you may run into other issues because of how the IR modules work and how FastLED writes data to NEOPIXEL. In the chipset reference page in their wiki they state:

Unfortunately, their data protocol requires disabling interrupts on the avr while writing data out, and so using these leds will interfere with things like IR libraries or using i2c and serial.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.