2017-03-16 14 views
0

다음은 Arduino에서 실행하려고하는 코드입니다.종료 상태 1을 얻고 있습니다. Arduino/Genuino Uno. 기본 IR 프로젝트를 수행하는 중입니다.

#include "IRremote.h" 

int receiver = 11; // Signal Pin of IR receiver to Arduino Digital Pin 11 

/*-----(Declare objects)-----*/ 
IRrecv irrecv(receiver);  // create instance of 'irrecv' 
decode_results results;  // create instance of 'decode_results' 

void setup() /*----(SETUP: RUNS ONCE)----*/ 
{ 
    Serial.begin(9600); 
    Serial.println("IR Receiver Button Decode"); 
    irrecv.enableIRIn(); // Start the receiver 

}/*--(end setup)---*/ 


void loop() /*----(LOOP: RUNS CONSTANTLY)----*/ 
{ 
    if (irrecv.decode(&results)) // have we received an IR signal? 

    { 
    translateIR(); 
    irrecv.resume(); // receive the next value 
    } 
    }/* --(end main loop)-- */ 

/*-----(Function)-----*/ 
void translateIR() // takes action based on IR code received 

// describing Remote IR codes 

{ 

    switch(results.value) 

    { 

    case 0xFF629D: Serial.println(" FORWARD"); break; 
    case 0xFF22DD: Serial.println(" LEFT"); break; 
    case 0xFF02FD: Serial.println(" -OK-"); break; 
    case 0xFFC23D: Serial.println(" RIGHT"); break; 
    case 0xFFA857: Serial.println(" REVERSE"); break; 
    case 0xFF6897: Serial.println(" 1"); break; 
    case 0xFF9867: Serial.println(" 2"); break; 
    case 0xFFB04F: Serial.println(" 3"); break; 
    case 0xFF30CF: Serial.println(" 4"); break; 
    case 0xFF18E7: Serial.println(" 5"); break; 
    case 0xFF7A85: Serial.println(" 6"); break; 
    case 0xFF10EF: Serial.println(" 7"); break; 
    case 0xFF38C7: Serial.println(" 8"); break; 
    case 0xFF5AA5: Serial.println(" 9"); break; 
    case 0xFF42BD: Serial.println(" *"); break; 
    case 0xFF4AB5: Serial.println(" 0"); break; 
    case 0xFF52AD: Serial.println(" #"); break; 
    case 0xFFFFFFFF: Serial.println(" REPEAT");break; 

    default: 
    Serial.println(" other button "); 

    }// End Case 

    delay(500); // Do not get immediate repeat 


} 

다음은 나의 오류 메시지입니다. (나는 첫 번째 고정 생각합니다.)

Arduino: 1.8.0 (Windows 8.1), Board: "Arduino/Genuino Uno" 

C:\(my folers) 
arduino\arduino\libraries\RobotIRremote\src\IRremoteTools.cpp:5:16: error: 'TKD2' was not declared in this scope 

int RECV_PIN = TKD2; // the pin the IR receiver is connected to 

       ^

Multiple libraries were found for "IRremote.h" 
Used: C:\Users\Mike\Desktop\Games\Zach arduino\arduino\libraries\RobotIRremote 
Not used: C:\Users\Mike\Documents\Arduino\libraries\Arduino-IRremote-master 
exit status 1 
Error compiling for board Arduino/Genuino Uno. 

This report would have more information with 
"Show verbose output during compilation" 
option enabled in File -> Preferences. 
+0

기존 답변을 무효화하는 질문을 변경해서는 안됩니다. 새로운 질문이있는 경우 ... 음 ... 새로운 질문을하십시오. –

+0

오. 승인. 이것은 나의 첫번째 포스트 이제까지있다 : | 죄송합니다. :) – LlamaProgramer

답변

0

오류는 예쁜 자기 설명 :

같은 라이브러리 파일이 마치 "여러 라이브러리 'IRremote.h'에 대한 발견" 두 곳에서. 하나를 삭제하면 컴파일러는 어느 것을 사용할 지 알게됩니다.

+0

예,하지만 여전히 라이브러리 중 하나를 사용했습니다. 사용 : C : \ Users \ Mike \ Documents \ Arduino \ libraries \ Arduino-IRremote-master – LlamaProgramer