loading

1. Sound Sensor INPUT

analog input, A0

2. LED OUT

digital output, PIN 3

3. Code

int LED = 3;

void setup(){

pinMode (LED, OUTPUT);

}

void loop() {

int statusSensor = analogRead(A0);

if (statusSensor > 200){

delay(100);

while(true){

digitalWrite(LED, HIGH);

int statusSensor = analogRead(A0);

if(statusSensor>200){

break;

}

}

delay(100);

}

else{

digitalWrite(LED, LOW);

}

}

<p>What model sound sensor are you using?</p>
<p>I used a old model. </p><p>Now, following site sells new model.</p><p>https://www.dfrobot.com/index.php?route=product/product&amp;product_id=83</p>
<p>That's a fun setup :) </p>

About This Instructable

294views

10favorites

License:

More by DAEHWANL:Sound Sensor + Arduino + clap(ON/OFF)  
Add instructable to: