阿正的网易云音乐 - 创建于 2017

一个大学生的学习心得,与君共勉。

tone() 和 IRremote 冲突的解决办法

tone()函数冲突

http://www.geek-workshop.com/thread-4037-1-1.html

可以自制函数newtone()

void newtone(byte tonePin, int frequency, int duration) {
int period = 1000000L / frequency;
int pulse = period / 2;
for (long i = 0; i < duration * 1000L; i += period) {
digitalWrite(tonePin, HIGH);
delayMicroseconds(pulse);
digitalWrite(tonePin, LOW);
delayMicroseconds(pulse);
}
}

后续修改库的方法,后续补上。

posted @ 2018-01-25 23:06  阿♛正  阅读(836)  评论(0编辑  收藏  举报