Keyestudio KS0436 Kit Manual page 182

Table of Contents

Advertisement

}
}
else{
digitalWrite(LEDpin,LOW);
}
}
It has no processing of the signal from the MIC, so signal is weak
and insensitive. Instead of sound signal, we blow air to the MIC.
Note:
By rotating the potentiometer, the analog value of A0 changes; After
adjusting the potentiometer, blow air into the MIC, and observe the
data in the serial monitor.
For example, the displayed data is less than 300 before blowing; after
blowing, data is more than 700.
Setup code
time of the LED is controlled by the code
if (Soundvalue
{ delay(1000);
>700), control the LED on and off; the on
}, so the light is on for 5*1s.
// turn off the LED
for(int i=0;i<5;i++)
182

Advertisement

Table of Contents
loading

Table of Contents