Hi I made a Microphone Module that when I blow into the mic, it produces a simple tone. Problem is that when I blow into the mic it doesn't consistently makes a proper sound when I blow, it makes spiky or jammed sounds and only makes a proper note when I blow into it hard. How do I avoid getting this output?
Here is my code by the way:
int senseMic = 0;
int speakerPin = 22;
void setup(){
Serial.begin(9600);
}
void loop(){
int val = analogRead(senseMic);
if (val > 540 || val < 490)
tone(speakerPin, freq);
else
noTone(speakerPin);
}
Hope you guys can help me. Thanks. Merry Christmas and a Happy New Year to you guys.
