Go Down

Topic: IRremote.h library won't compile on attiny85 (Read 11357 times) previous topic - next topic

brraaq

get error :
Code: [Select]

C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRsend::mark(int)':
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:227: error: 'TCCR2A' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:227: error: 'COM2B1' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRsend::space(int)':
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:235: error: 'TCCR2A' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:235: error: 'COM2B1' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRsend::enableIROut(int)':
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:253: error: 'TIMSK2' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:263: error: 'TCCR2A' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:263: error: 'WGM20' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:263: error: 'TCCR2B' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:263: error: 'WGM22' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:263: error: 'CS20' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:263: error: 'OCR2A' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:263: error: 'OCR2B' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRrecv::enableIRIn()':
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:279: error: 'TCCR2A' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:279: error: 'WGM21' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:279: error: 'TCCR2B' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:279: error: 'CS20' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:279: error: 'OCR2A' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:279: error: 'TCNT2' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:282: error: 'TIMSK2' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:282: error: 'OCIE2A' was not declared in this scope


my code is :
Code: [Select]

#include <IRremote.h>
int RECV_PIN = 3;
IRrecv irrecv(RECV_PIN);
decode_results results;
int buttonState = 0;
int lastpressed = 0;
int i = 1;
long previousMillis = 0;   
long interval = 120000; 
int ledState = HIGH;
int relay =  12; 
int st =  11;   
int re =  10;   
void setup() {
  Serial.begin(9600);
  irrecv.enableIRIn();
  pinMode(relay, OUTPUT);     
  pinMode(st, OUTPUT);   
  pinMode(re, OUTPUT);   
}

void loop() {

unsigned long codeValue;
  if (irrecv.decode(&results) ) {
Serial.println (results.value, DEC) ;
 
  codeValue = results.value;
      irrecv.resume();
  }
   if (codeValue == 83579055){
   i = 1;
  }
   if (codeValue == 83570895){
   i = 0;
   }

   if ( i == 1 ) {
       digitalWrite(st, HIGH);
       digitalWrite(re, LOW);
       digitalWrite(relay, ledState);

       unsigned long currentMillis = millis();
  if(currentMillis - previousMillis > interval) {
    // save the last time you blinked the LED
    previousMillis = currentMillis;   

    if (ledState == LOW)
      ledState = HIGH;
    else
      ledState = LOW;

    // set the LED with the ledState of the variable:
       digitalWrite(relay, ledState);
   }
   } else {
       digitalWrite(st, LOW);
       digitalWrite(relay, LOW);
       digitalWrite(re, HIGH);
   }

delay(10);
}



larryd

Where did you install your IRremote library?
No technical PMs.
The last thing you did is where you should start looking.

Erni

You are using a library that is not supported by ATtiny85.
(among other things Attiny85 dos not have a TIMER2)

You could try this:

http://tetalab.org/blog/librairie-ir-nec-pour-attiny85

brraaq

same problem with attiny library

error :
Code: [Select]

In file included from C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:13:
C:\Program Files (x86)\Arduino\libraries\IRremote\/IRremoteInt.h:97: error: 'uint8_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\IRremote\/IRremoteInt.h:98: error: 'uint8_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\IRremote\/IRremoteInt.h:99: error: 'uint8_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\IRremote\/IRremoteInt.h:102: error: 'uint8_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRsend::mark(int)':
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:176: error: 'TCCR2A' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:176: error: 'COM2B1' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:178: error: 'delayMicroseconds' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRsend::space(int)':
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:188: error: 'TCCR2A' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:188: error: 'COM2B1' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:190: error: 'delayMicroseconds' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRsend::enableIROut(int)':
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:210: error: 'TIMSK2' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:210: error: 'TOIE2' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:213: error: 'OUTPUT' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:213: error: 'pinMode' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:214: error: 'LOW' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:214: error: 'digitalWrite' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:228: error: 'TCCR2A' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:228: error: 'WGM20' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:229: error: 'TCCR2B' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:229: error: 'WGM22' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:229: error: 'CS20' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:232: error: 'OCR2A' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:233: error: 'OCR2B' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp: In constructor 'IRrecv::IRrecv(int)':
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:241: error: 'volatile struct irparams_t' has no member named 'recvpin'
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:242: error: 'volatile struct irparams_t' has no member named 'blinkflag'
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRrecv::enableIRIn()':
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:262: error: 'TCCR2A' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:267: error: 'TCCR2B' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:267: error: 'CS22' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:268: error: 'CS21' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:269: error: 'CS20' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:272: error: 'TIMSK2' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:272: error: 'TOIE2' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:278: error: 'TCNT2' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:283: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:284: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:288: error: 'volatile struct irparams_t' has no member named 'recvpin'
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:288: error: 'INPUT' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:288: error: 'pinMode' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRrecv::blink13(int)':
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:294: error: 'volatile struct irparams_t' has no member named 'blinkflag'
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:296: error: 'OUTPUT' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:296: error: 'pinMode' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp: In function 'void __vector_5()':
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:308: error: 'TCNT2' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:310: error: 'volatile struct irparams_t' has no member named 'recvpin'
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:310: error: 'digitalRead' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:313: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:315: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:317: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:326: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:327: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:329: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:335: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:337: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:342: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:344: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:352: error: 'volatile struct irparams_t' has no member named 'rcvstate'
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:363: error: 'volatile struct irparams_t' has no member named 'blinkflag'
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:365: error: 'B00100000' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:368: error: 'B11011111' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRrecv::resume()':


Erni

Code: [Select]
C:\Program Files (x86)\Arduino\libraries\IRremote\IRremote.cpp:176: error: 'TCCR2A' was not declared in this scope

You are still using a library, that is not supported for ATtiny85

brraaq

i use this library
http://tetalab.org/blog/librairie-ir-nec-pour-attiny85

brraaq

problem with code ?
Code: [Select]

#include <IRremote.h>
int RECV_PIN = 3;
IRrecv irrecv(RECV_PIN);
decode_results results;
int buttonState = 0;
int lastpressed = 0;
int i = 1;
long previousMillis = 0;   
long interval = 120000; 
int ledState = HIGH;
int relay =  2; 
int st =  1;   
int re =  0;   
void setup() {
  irrecv.enableIRIn();
  pinMode(relay, OUTPUT);     
  pinMode(st, OUTPUT);   
  pinMode(re, OUTPUT);   
}

void loop() {

unsigned long codeValue;
  if (irrecv.decode(&results) ) {
 
  codeValue = results.value;
      irrecv.resume();
  }
   if (codeValue == 526073 || codeValue == 83579055){
   i = 1;
  }
   if (codeValue == 575033 || codeValue == 83570895){
   i = 0;
   }

   if ( i == 1 ) {
       digitalWrite(st, HIGH);
       digitalWrite(re, LOW);
       digitalWrite(relay, ledState);

       unsigned long currentMillis = millis();
  if(currentMillis - previousMillis > interval) {
    // save the last time you blinked the LED
    previousMillis = currentMillis;   

    if (ledState == LOW)
      ledState = HIGH;
    else
      ledState = LOW;

    // set the LED with the ledState of the variable:
       digitalWrite(relay, ledState);
   }
   } else {
       digitalWrite(st, LOW);
       digitalWrite(relay, LOW);
       digitalWrite(re, HIGH);
   }
delay(10);
}



hiduino

#7
Aug 01, 2013, 11:29 pm Last Edit: Aug 01, 2013, 11:39 pm by hiduino Reason: 1
You need to use a different tiny core from, https://code.google.com/p/arduino-tiny/downloads/detail?name=arduino-tiny-0100-0017.zip&can=2&q=

The tetalab.org seems unreachable, but I believe that site is referencing to Nick Gammons port of the IRremote for the tiny85.  http://forum.arduino.cc/index.php?topic=91488.msg688501#msg688501
http://gammon.com.au/Arduino/IRremote_Attiny.zip

This IRremote library compiles fine using the arduino-tiny link provided above.

brraaq

now i lave this error
Code: [Select]

c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn85.o:(.init9+0x2): relocation truncated to fit: R_AVR_13_PCREL against symbol `exit' defined in .fini9 section in c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a(_exit.o)


Coding Badly


Linker bug.  One of two possible solutions... http://forum.arduino.cc/index.php?topic=116674.0

brraaq

Now it's work thank you thank you thank you

Sonnytkt

Hi, I have an issue and i can't figure out how to solve it.
I have followed every single step and I managed to upload the library without errors and it works, but every time i press a remote button the result, instead of being a series of numbers, is just a zero, no matter what button i press. I am sure it's a 0 because I managed to take a serial reading of the results.value...Any possible solutions?

dizzzy

I've got exactly the same error as @Sonnytkt ,

IRrecv.decode(&results) is triggered, but results.value == 0. Always. Has anyone figured it out?

atTiny85 20PU

zasf

#13
Mar 23, 2015, 08:20 pm Last Edit: Mar 23, 2015, 09:03 pm by zasf
I'm trying to compile Nick Gammon's IRremote_Attiny library on Arduino IDE 1.6.1, with tiny's core from http://highlowtech.org/?p=1695 and I'm getting the following error:

Code: [Select]
Arduino:1.6.1 (Mac OS X), Scheda:"ATtiny, ATtiny85, 8 MHz (internal)"

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/bin/ld: Dwarf Error: mangled line number section.
core.a(wiring.c.o): In function `__vector_5':
wiring.c:(.text.__vector_5+0x0): multiple definition of `__vector_5'
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/bin/ld: Dwarf Error: mangled line number section.
IRremote_Attiny/IRremote_Attiny.cpp.o:IRremote_Attiny.cpp:(.text.__vector_5+0x0): first defined here
collect2: error: ld returned 1 exit status
Errore durante la compilazione


any ideas?

zasf

it seems that TIMER0_OVF_vect is defined in my core for the interrupt used by millis().

Go Up