Clap Switch Circuit

0
Favorite
2
copy
Copy
168
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-1058688

Copy of Clap Switch Circuit

user-1058688
Profile image for user-1058688

Copy of Clap Switch Circuit

user-1058688

Creator

user-19819

23 Circuits

Date Created

1 year, 9 months ago

Last Modified

1 year, 9 months ago

Tags

  • code for clap switch

Circuit Copied From