Code And Circuit Diagram For Controlling Room Lights With A Clap
int micPin = A0;
int gndPin = A1;
int powerPin = A2;
int micValue1 = 0;
int micValue2 = 0;
int led1 = 13;
boolean lightOn = false;
void setup() {
pinMode(led1, OUTPUT);
pinMode(powerPin, OUTPUT);
pinMode(gndPin, OUTPUT);
pinMode(micPin, INPUT);
digitalWrite(gndPin,LOW);
delay(500);
digitalWrite(powerPin,HIGH);
Serial.begin(9600);
}
void loop() {
micValue1 = analogRead(micPin);
Serial.println(micValue1);
delay(1);
micValue2 = analogRead(micPin);
Serial.println(micValue2);
if (micValue1-micValue2 > 2||micValue2-micValue1 > 2){
lightOn = !lightOn;
delay(100);
digitalWrite(led1, lightOn);
}
}
IF YOU ARE GETTING A STRAY ERROR CLICK HERE
can u please help me for more detail about this project
Yes sir
Gratifying website with cluster of ads… Authentic ad_earning. Suprisingly not suprised.
I’ll remove them sir sorry
where is the circuit diagram ???
Soo sorry for that brother … I’ll do it today positively
Hi there,
bro where is the circuit diagram? There is no link for the circuit diagram and what about the android app you used? How to get that app?
I didn’t use any app for this . And for circuit I’ll upload a diagram soon..
Bro I need circuit diagram please upload it soon
Sure mate