Clap Switch Circuit

0
Favorite
2
copy
Copy
319
Views
Clap Switch Circuit

Circuit Description

Graph image for Clap Switch Circuit

Circuit Graph

const int ledpin=13; // led pin and sound pin are not changed throughout the process const int soundpin=A2; const int threshold=200; // sets threshold for sound sensor void setup() { Serial.begin(9600); pinMode(ledpin,OUTPUT); pinMode(soundpin,INPUT); } void loop() { int soundsens=analogRead(soundpin); // read analog data from sensor if (soundsens>=threshold) { digitalWrite(ledpin, HIGH); // turn led on delay(1000); } else{ digitalWrite(ledpin, LOW); } }

There are currently no comments

Profile image for user-19819

Clap Switch Circuit

user-19819
Profile image for user-20798

Clap Switch Circuit

user-20798

Creator

ayush77singh

1 Circuit

Date Created

2 years, 3 months ago

Last Modified

2 years, 3 months ago

Tags

  • code for clap switch

Circuit Copied From