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++;
}