hansibull:
In order to get the IRremote library to work, you'll have to manually download and install the library. You can get it from here. Click the green "clone or download" button.
hello i've tried to upload this code to an attiny2313 @8mhz internal clock.
#include <IRremote.h>
const int pin=4;
const int led=9;
int toggle=0;
IRrecv irrecv(pin);
decode_results results;
void setup() {
irrecv.enableIRIn();
pinMode(led,OUTPUT);
}
void loop() {
if(irrecv.decode(&results)){
if(results.value==0x1000C||0xC||0x17AB7F3E){
if(toggle==0){
digitalWrite(led,HIGH);
toggle=1;
}
else{
digitalWrite(led,LOW);
toggle=0;
}
}
irrecv.resume();
}
}
pretty simple really, just trying something.
it will give me a lot of errors in the verbose, they're so many that i think is rude to post them all, but i can do if needed. but the errors look mostly like this.
G:\arduino\libraries\IRremote\boarddefs.h:217:29: error: 'WGM22' was not declared in this scope
TCCR2B = _BV(WGM22) | _BV(CS20); \
^
G:\arduino\libraries\IRremote\irSend.cpp:119:2: note: in expansion of macro 'TIMER_CONFIG_KHZ'
TIMER_CONFIG_KHZ(khz);
^
G:\arduino\libraries\IRremote\boarddefs.h:217:42: error: 'CS20' was not declared in this scope
TCCR2B = _BV(WGM22) | _BV(CS20); \
^
G:\arduino\libraries\IRremote\irSend.cpp:119:2: note: in expansion of macro 'TIMER_CONFIG_KHZ'
TIMER_CONFIG_KHZ(khz);
^
In file included from G:\arduino\libraries\IRremote\IRremoteInt.h:111:0,
from G:\arduino\libraries\IRremote\IRremote.h:24,
from G:\arduino\libraries\IRremote\irSend.cpp:1:
G:\arduino\libraries\IRremote\boarddefs.h:218:2: error: 'OCR2A' was not declared in this scope
OCR2A = pwmval; \
^
G:\arduino\libraries\IRremote\irSend.cpp:119:2: note: in expansion of macro 'TIMER_CONFIG_KHZ'
TIMER_CONFIG_KHZ(khz);
^
G:\arduino\libraries\IRremote\boarddefs.h:219:2: error: 'OCR2B' was not declared in this scope
OCR2B = pwmval / 3; \
^
G:\arduino\libraries\IRremote\irSend.cpp:119:2: note: in expansion of macro 'TIMER_CONFIG_KHZ'
TIMER_CONFIG_KHZ(khz);
^
i have the feeling that the attiny is not compatible with the library.