LED BLINKER ON ARDUINO

I'm doing a project where I make an led glow on receiving a sound signal from a sound sensor. The lights up correctly ,but the code i have written is incorrect.

int led = 13;
int val=0;
int buttonpin=2;

void setup() {
Serial.begin(9600); // For debugging
pinMode(led, OUTPUT);
}

void loop() {

val = digitalRead(buttonpin);
/*
//Debug mode
Serial.println(volume);
delay(100);
*/

if(val==HIGH){
digitalWrite(led, LOW);
}
else{
digitalWrite(led, HIGH);
}

}

Go and read the instructions, then go back and modify your post (use the “More → Modify” option to the bottom right of the post) to mark up the code as such so we can examine it conveniently and accurately.

If you do not do this, the code you post could well be garbled.

Note: Also mark up any data in the same way. This includes error output that you get from the IDE.

Until you reply and demonstrate that you understand these points that have been made so far, there is absolutely no point working through any other problems with the code, so I will leave it at that for the present.

. . . and to save you wondering where the other copy of your post in Displays went, I deleted it.

DO NOT CROSS-POST, CROSS-POSTING WASTES TIME.