Hello good day developers, I am working on this project to make an IR receiver with Attiny 85, where it validates NEC codes with the IRremote Library, depending on the code received gives me a color on the WS2812B strip, I have tested it on an arduino one and it works correctly, but when uploading the program to the Attiny85 it does not work. Can anyone help me?
I am using the IRermote library in its version 3.9.0
#include <IRremote.h>
#include <Adafruit_NeoPixel.h> // importa libreria, debe instala previamente
#define DOUT 3
#define DIN 2
int nleds=4; // Numero de LEDs
int brillo = 100; // Brillo del LED
Adafruit_NeoPixel tira = Adafruit_NeoPixel(nleds, 3, NEO_GRB + NEO_KHZ800); // Pin 3 del Arduino es salida de datos
int receiver = DIN;
IRrecv irrecv(receiver);
decode_results results;
void setup(){
irrecv.enableIRIn();
tira.begin(); // inicializacion de la tira
tira.show();
tira.setBrightness(brillo); // Brillo de los LEDs
pinMode(DOUT, OUTPUT);
pinMode(DIN, INPUT);
}
void loop()
{
if (irrecv.decode(&results))
{
switch(results.value)
{
case 0x97CDCD9E: azul(); break;
case 0x27C66185: blanco(); break;
case 0x3FC4F8D8: verde(); break;
case 0x1BC28195: rojo(); break;
case 0xDFEE3624: negro(); break;
case 0x7F0B3B7: azul(); parpadeo(); break;
case 0xE78CE340: blanco(); parpadeo(); break;
case 0xC38A6BFD: rojo(); parpadeo(); break;
case 0x6183EEB8: secuencia();break;
case 0x89866C4B: tono(); break;
case 0xC8CA1DB6: rojo(); desvanecer();break;
case 0xA4C7A673: parpadeo2();break;
case 0xA2504734: parpadeo3();break;
case 0xCA52C4C7: parpadeo4();break;
case 0xA9EEF450: total(); break;
case 0x85EC7D0D: IDUnic(); desvanecer(); break;
case 0x00FF52AD: blanco(); break;
}
irrecv.resume();
}
delay(300);
}
void IDUnic(){
int red = random(0, 256);
int green = random(0, 256);
int blue = random(0, 256);
for (int i = 0; i < nleds; i++) {
tira.setPixelColor(i, tira.Color(red, green, blue));
}
tira.show();
}
void azul(){
for (int i=0;i<nleds;i++){
tira.setPixelColor(i,0,0,255);
}
tira.show();
}