【发布时间】:2013-10-25 02:12:45
【问题描述】:
事实证明,noTone() 和 tone() 在核心 arduino API 中,但 seemingly not implemented 用于 Arduino Due。我希望使用tone() 和noTone() 来实现这里找到的马里奥死亡声音,但是当我添加代码并编译它时,我收到以下错误:
trenchRun:154: error: 'tone' was not declared in this scope trenchRun:156: error: 'noTone' was not declared in this scope
如果您有兴趣,这里有一个 SSCCE,在 Mac OS X 10.8 上针对 Arduino 1.5.4 编译:
void setup() {
// put your setup code here, to run once:
}
void loop() {
tone(1, 12345, 1000);
}
sketch_oct24a.ino: In function 'void loop()': sketch_oct24a:7: error: 'tone' was not declared in this scope
由于我有一个 Arduino Due,我只能使用 Arduino 1.5.4。
如何为 Due 实现 tone() 和 noTone() 函数?
【问题讨论】: