Skip to content

Instantly share code, notes, and snippets.

@li2hub
Last active October 16, 2018 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save li2hub/f00994c27b30d3516093a9965eed6ec0 to your computer and use it in GitHub Desktop.
Save li2hub/f00994c27b30d3516093a9965eed6ec0 to your computer and use it in GitHub Desktop.
void setup(){
pinMode(2,INPUT);
Serial.begin(9600);
}
void loop(){
if (digitalRead(2)==HIGH)
{
Serial.println("Sound Detected!");
}
else
{
Serial.println("No Sound");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment