0
私はattiny45チップを備えたIRリモートライブラリを使用しています。コードはArduinoでうまく動作しますが、attiny45チップにアップロードするときにエラーメッセージが表示されます。attiny45チップとirリモートライブラリのプログラミング
アップロードするとき、私は、次のエラーメッセージが出てい#include <IRremote.h>
int RECV_PIN = 2;
int led = 1;
int relay = 0;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
irrecv.enableIRIn(); // Start the receiver
pinMode (led, OUTPUT);
pinMode (relay, OUTPUT);
}
void loop() {
if (irrecv.decode(&results)) {
switch (results.value) {
case 0xff02fd :
digitalWrite(led, HIGH);
digitalWrite(relay, LOW);
break;
case 0x1FC42BD :
digitalWrite(led, HIGH);
digitalWrite(relay, LOW);
break;
default :
digitalWrite(led, LOW);
digitalWrite(relay, HIGH);
break;
}
irrecv.resume(); // Receive the next value
}
}
: アルドゥイーノ:1.8.1(Windows 7の)、理事会: "ATtiny25/45/85 ATtiny45、内部8 MHzの"
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRsend::mark(int)':
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:176:3: error: 'TCCR2A' was not declared in this scope
TCCR2A |= _BV(COM2B1); // Enable pin 3 PWM output
^
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremoteInt.h:15,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:13:
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:176:17: error: 'COM2B1' was not declared in this scope
TCCR2A |= _BV(COM2B1); // Enable pin 3 PWM output
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRsend::space(int)':
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:188:3: error: 'TCCR2A' was not declared in this scope
TCCR2A &= ~(_BV(COM2B1)); // Disable pin 3 PWM output
^
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremoteInt.h:15,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:13:
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:188:19: error: 'COM2B1' was not declared in this scope
TCCR2A &= ~(_BV(COM2B1)); // Disable pin 3 PWM output
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRsend::enableIROut(int)':
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:210:3: error: 'TIMSK2' was not declared in this scope
TIMSK2 &= ~_BV(TOIE2); //Timer2 Overflow Interrupt
^
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremoteInt.h:15,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:13:
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:210:18: error: 'TOIE2' was not declared in this scope
TIMSK2 &= ~_BV(TOIE2); //Timer2 Overflow Interrupt
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:228:3: error: 'TCCR2A' was not declared in this scope
TCCR2A = _BV(WGM20);
^
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremoteInt.h:15,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:13:
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:228:16: error: 'WGM20' was not declared in this scope
TCCR2A = _BV(WGM20);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:229:3: error: 'TCCR2B' was not declared in this scope
TCCR2B = _BV(WGM22) | _BV(CS20);
^
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremoteInt.h:15,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:13:
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:229:16: error: 'WGM22' was not declared in this scope
TCCR2B = _BV(WGM22) | _BV(CS20);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:229:29: error: 'CS20' was not declared in this scope
TCCR2B = _BV(WGM22) | _BV(CS20);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:232:3: error: 'OCR2A' was not declared in this scope
OCR2A = SYSCLOCK/2/khz/1000;
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:233:3: error: 'OCR2B' was not declared in this scope
OCR2B = OCR2A/3; // 33% duty cycle
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp: In member function 'void IRrecv::enableIRIn()':
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:262:3: error: 'TCCR2A' was not declared in this scope
TCCR2A = 0; // normal mode
^
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremoteInt.h:15,
from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:13:
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:267:7: error: 'TCCR2B' was not declared in this scope
cbi(TCCR2B,CS22);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:267:3: note: in expansion of macro 'cbi'
cbi(TCCR2B,CS22);
^
Multiple libraries were found for "IRremote.h"
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:267:14: error: 'CS22' was not declared in this scope
Used: C:\Users\Acer\Documents\Arduino\libraries\IRremote
cbi(TCCR2B,CS22);
Not used: C:\Users\Acer\Documents\Arduino\libraries\IRremote1
^
Not used: C:\Users\Acer\Documents\Arduino\libraries\Arduino-IRremote-master
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:267:3: note: in expansion of macro 'cbi'
cbi(TCCR2B,CS22);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:268:14: error: 'CS21' was not declared in this scope
sbi(TCCR2B,CS21);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:268:3: note: in expansion of macro 'sbi'
sbi(TCCR2B,CS21);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:269:14: error: 'CS20' was not declared in this scope
cbi(TCCR2B,CS20);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:269:3: note: in expansion of macro 'cbi'
cbi(TCCR2B,CS20);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:272:7: error: 'TIMSK2' was not declared in this scope
sbi(TIMSK2,TOIE2);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:272:3: note: in expansion of macro 'sbi'
sbi(TIMSK2,TOIE2);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:272:14: error: 'TOIE2' was not declared in this scope
sbi(TIMSK2,TOIE2);
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:272:3: note: in expansion of macro 'sbi'
sbi(TIMSK2,TOIE2);
^
In file included from C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:13:0:
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremoteInt.h:46:24: error: 'TCNT2' was not declared in this scope
#define RESET_TIMER2 TCNT2 = INIT_TIMER_COUNT2
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:278:3: note: in expansion of macro 'RESET_TIMER2'
RESET_TIMER2;
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp: In function 'void __vector_5()':
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremoteInt.h:46:24: error: 'TCNT2' was not declared in this scope
#define RESET_TIMER2 TCNT2 = INIT_TIMER_COUNT2
^
C:\Users\Acer\Documents\Arduino\libraries\IRremote\IRremote.cpp:308:3: note: in expansion of macro 'RESET_TIMER2'
RESET_TIMER2;
^
exit status 1
Error compiling for board ATtiny25/45/85.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
を
これは私が使用しているのArduinoのバージョンです: アルドゥイーノ:1.8.1(Windows 7の)、理事会: "ATtiny25/45/85 ATtiny45、内部8 MHzの"
IRremoteライブラリはArduino Pin 3の出力でのみ動作するモードでタイマ2を使用するため、ピン3(_BV(ビット)マクロ)は使用できません。Instructable:http:// www .instructables.com/id/Attiny-IRライブラリー/?ALLSTEPS – Philip
ピン3は、attinyのピンがどういう意味ですか? – Shaam
はい、それはArduino UNOのピン3で、ハードコードされています。 – Philip