6176| 5
|
[求助] 小白一枚,求各位大神指点,编译有误 |
#include <IRremote.h> int RECV_PIN = 11; int ledPin = 10; // LED – digital 10 boolean ledState = LOW; // ledstate用来存储LED的状态 IRrecv irrecv(RECV_PIN); decode_results results; void setup(){ Serial.begin(9600); irrecv.enableIRIn(); pinMode(ledPin,OUTPUT); // 设置LED为输出状态 pinMode(9,OUTPUT); } void loop() { if (irrecv.decode(&results)) { Serial.println(results.value, HEX); //一旦接收到电源键的代码, LED翻转状态,HIGH变LOW,或者LOW变HIGH if(results.value == 0xFF6897){ ledState = !ledState; //取反 digitalWrite(ledPin,ledState); //改变LED相应状态 tone(9,1000); } irrecv.resume(); } } 想利用红外遥控器指挥蜂鸣器工作,原来的红外接收模块是好使的,但是在加入tone函数之后,编译就通不过,错误信息如下: C:\temp\build415033132321862447.tmp/core.a(Tone.cpp.o): In function `__vector_7': D:\Arduino-1.6.5-r2\hardware\arduino\avr\cores\arduino/Tone.cpp:538: multiple definition of `__vector_7' IRremote\IRremote.cpp.o:D:\arduino-1.6.5-r2\libraries\IRremote/IRremote.cpp:312: first defined here collect2.exe: error: ld returned 1 exit status Multiple libraries were found for "IRremote.h" Used: D:\arduino-1.6.5-r2\libraries\IRremote Not used: D:\arduino-1.6.5-r2\libraries\RobotIRremote 编译有误 |
© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed