IRremote attiny84 delay error

I am using the library irremote, for attiny84. I have used the following tutorial http://www.instructables.com/id/Attiny-IR-library/.

My problem is that the delay function behaves strangely. It seems like delay(50000) is the equivalent of delay(1000). When i use delay(50000) it seems

I use the following code:

#include <IRremote.h>



IRsend irsend;


void setup()
{
}

void loop() {

  
  
  unsigned int raw[41] =       
{0x47,0x1F,0xB,0x17,0xA,0x17,0xB,0x6, 0xA,0x6,
 0xB, 0x6, 0xA,0x17,0xB,0x6, 0xA,0x6, 0xB,0x17,
 0xA, 0x17,0xA,0x7, 0xA,0x17,0xA,0x7, 0xA,0x6,
 0xB, 0x17,0xA,0x17,0xA,0x6, 0xB,0x17,0xA,0x17,};
  
     irsend.sendRaw(raw,41,38);
    delay(1000);
    irsend.sendRaw(raw,41,38);
    delay(1000);

}

When i use an ordanary led, the led flashes really fast and when i use delay(50000) its about 1 seconds between the blinks

I have tried to run the blink sketch, and it works fine with the normal delay(1000). so it isn’t because of a wrong bootloader or something like that (I don’t think it is).

I hope somebody can help me.

I'd guess that the IR library is using the same timer that is used for millis()/delay(). Check the IR library and your '84 core to see if there's a conflict.

Thanks for the answer.

I am really new in all of this. What exactly should I look for?

You need to provide links to the ATtiny core and IRremote library you're using. Is your IR library specifically for the ATtiny chip?

I tried to change the attiny core to this https://code.google.com/p/arduino-tiny/downloads/detail?name=arduino-tiny-0150-0020.zip&can=2&q= because i didn't now which core i used. And i use this library: http://gammon.com.au/Arduino/IRremote_Attiny.zip I have modified the library.

The thing I did, was making it work with the attiny84.

I changed this:

#if defined (__AVR_ATtinyX5__)
  TIMSK0 &= ~_BV(TOIE0); //Timer2 Overflow Interrupt
#else
  TIMSK2 &= ~_BV(TOIE2); //Timer2 Overflow Interrupt
#endif

Into this:

  TIMSK0 &= ~_BV(TOIE0); //Timer2 Overflow Interrupt

And all other places where it says if defined (AVR_ATtinyX5)

Now it isn't the same problem. The problem i get now is that the delay function doesn't work, it's like it's just stop running after the first ir-code is send. If the delay time is low (delay(250) or lower) the ir-codes are beeing send a few times and then stops just like when it isn't low.

Is it because it doesn't work with attiny84 but only attiny85?

I also changed TIMSK to TIMSK0

The bit-patterns of TIMSK and TIMSK0 are different, so you need to have a look at the datasheets to see how they compare (a bit beyond me, I'm afraid).