我在Arduino上运行这段代码。使用Arduino,有没有办法将音频传递给我的PC扬声器?为了让音频能够通过Arduino通过PC扬声器播放,我需要添加些什么?
//This imports the audio class
#include <PCM.h>
//This is the sound being played
const unsigned char sound1[] PROGMEM = {129, 127, 126, 127, 128, 128, 128, 12};
//constant variables
const int knockSensor = A0;
const int threshold1 = 10;
//This create a variable
int sensorReading = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
sensorReading = analogRead(knockSensor);
if (sensorReading >= threshold1) {
Serial.println(threshold1);
startPlayback(sound1, sizeof(sound1));
}
delay(200);
}
Arduino如何物理连接到PC扬声器(直接或间接)? – 2012-03-08 18:19:37