【问题标题】:How do I implement tone() and noTone() for the Arduino Due?如何为 Arduino Due 实现tone() 和 noTone()?
【发布时间】: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() 函数?

【问题讨论】:

    标签: c arduino


    【解决方案1】:

    是的,在当前版本中它似乎仍然被禁用。

    在 Arduino 论坛上快速搜索得到了这个:Arduino Due and tone() 我无法测试他们的代码,但似乎这家伙找到了一个相当不错的解决方案来制作自己的tone()

    看看并告诉我们它是否运作良好。

    希望对您有所帮助! :)

    【讨论】:

    • 我可以验证他的代码在 Arduino Due 上运行良好。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-03-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多