Sound Sensor (with LED)

Featured Video Play Icon
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
int soundSensor = 2;
int LED = 3;

void setup()
{

  pinMode (soundSensor, INPUT);
  pinMode (LED, OUTPUT);
}

void loop()
{
  int statusSensor = digitalRead (soundSensor);
 
  if (statusSensor == 1)
  {
    digitalWrite(LED, HIGH);
  }
 
  else
  {
    digitalWrite(LED, LOW);
  }
 
}

Leave a Reply

Your email address will not be published. Required fields are marked *