我正试着用我的arduino mega 25600在2个蜂鸣器上播放一首歌,但我的C++很烂。我已经弄清楚如何在一个蜂鸣器上演奏,但我想在两个不同的蜂鸣器上同时演奏两个不同的旋律。下面是我的代码: #include "piezo-music.h"
// put your setup code here, to run once:
我正在使用MATLAB中的sound()函数来生成音调。以下函数以440 The播放音调4秒:toneFreq = 440sound(y, samplesPerSecond); % play the sound wave at the specified bit rate
偶尔(在使用这个函数几次之后),我从MATLAB得到一