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);
}
}

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

相关文章:

  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2021-06-10
  • 2022-01-20
猜你喜欢
  • 2022-01-07
  • 2022-12-23
  • 2022-02-05
  • 2022-02-02
  • 2022-01-21
相关资源
相似解决方案