Sound Detection Sensor
From Microduino Wiki
Revision as of 02:08, 5 November 2015 by 1304410487@qq.com (talk) (→Experiment: To Detect Sound Intensity)
ContentsOutlineSound detection sensor can detect sound intensity but cannot recognize the specified sound.
Specification
DevelopmentEquipment
Preparation
Experiment: To Detect Sound Intensity
#define mic_pin A0
int sensorValue;
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
pinMode(mic_pin, INPUT);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
sensorValue = analogRead(mic_pin);
// print out the value you read:
Serial.print("Sound:");
Serial.println(sensorValue);
delay(100); // delay in between reads for stability
}
Program Debugging
Video |