دائرة تعمل بالتصفيق باستخدام اردوينو نانو

Clap Switch Circuit Using Arduino Nano

Schematic Diagram of Clap Switch Circuit Using Arduino Nano
// Clap Switch using Arduino Nano & Sound Module .. 
// By : Ahmed Samir Fayed www.Qariya.net
#define sound_sensor 12
#define led          3
void setup() 
{
 pinMode(sound_sensor,INPUT);
 pinMode(led,OUTPUT);
 digitalWrite(led,LOW);
}
void loop() 
{
 while(digitalRead(sound_sensor)==HIGH);
 digitalWrite(led,!digitalRead(led));
 delay(100); 
}