Clap Switch Circuit

0
Favorite
0
copy
Copy
105
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

Creator

user-20798

7 Circuits

Date Created

1 year, 3 months ago

Last Modified

1 year, 3 months ago

Tags

  • code for clap switch

Circuit Copied From