// t3216 Sound pin - PA7 Led pin =7 const int ledpin=7; // ledpin and soundpin are not changed throughout the process const int soundpin=A7; const int threshold=200; // sets threshold value for sound sensor void setup() { Serial.begin(9600); pinMode(ledpin,OUTPUT); pinMode(soundpin,INPUT); } void loop() { int soundsens=analogRead(soundpin); // reads analog data from sound sensor Serial.println(soundsens); //reads soundsensor value if (soundsens>=threshold) { digitalWrite(ledpin,HIGH); //turns led on delay(500); } else{ digitalWrite(ledpin,LOW); } }