DISCO LIGHTS EFFECT WITH SOUND SENSOR
CLAP SENSOR || SENSORS || #112
COMPONENTS REQUIRED:
1. SOUND SENSOR.
2. ARDUINO UNO.
3. JUMPER WIRES.
4. LED'S
CIRCUIT :
SOURCE CODE:
int SoundSensor = 2;
int LED = 13;
int sensor;
void setup(){
pinMode(SoundSensor, INPUT);
pinMode(LED, OUTPUT);
}
void loop(){
sensor = digitalRead(SoundSensor);
if (sensor == 1){
digitalWrite(LED, HIGH);
}
else{
digitalWrite(LED, LOW);
}
}
int LED = 13;
int sensor;
void setup(){
pinMode(SoundSensor, INPUT);
pinMode(LED, OUTPUT);
}
void loop(){
sensor = digitalRead(SoundSensor);
if (sensor == 1){
digitalWrite(LED, HIGH);
}
else{
digitalWrite(LED, LOW);
}
}
Comments
Post a Comment