//Sound Control Light int soundPin = 2; // sound sensor is to be attached to digital int ledPin = 0; // Digital LED is to be attached to digital void setup() { pinMode(ledPin, OUTPUT); pinMode(soundPin, INPUT); Serial.begin(9600); } void loop(){ int soundState = digitalRead(soundPin); // Read sound sensor’s value Serial.println(soundState); // if the sound sensor’s value is greater than 400, the light will be on. //Otherwise, the light will be turned off if (soundState == HIGH) { digitalWrite(ledPin, HIGH); delay(1000); }else{ digitalWrite(ledPin, LOW); } delay(1000); }