【发布时间】:2012-02-28 06:32:28
【问题描述】:
我有从 arduino 播放一点声音的代码。这首歌是根据数值编码的。但是如何让它在 arduino 上播放得更响亮呢?
#include <PCM.h>
int switchPin = 8;
const unsigned char sample[] PROGMEM = {
140, 124, 130, 126, 129, 126, 128, 127, 128, 127, 128, 127, 128, 127, 128, 127, 128, 127, 128, 127, 128, 127, 128, 127, 128, 127, 128, 127, 128, 127, 128, 127, 128, 128, 128, 128,
};
void setup()
{
pinMode(switchPin, INPUT);
}
void loop()
{
if(digitalRead(switchPin) == HIGH)
{
startPlayback(sample, sizeof(sample));
}
}
【问题讨论】:
-
您有机会尝试我回答中的建议吗?