Interrupt

I'm new to arduino

I have written a code for following task
when I pressed a push button(pin 2) i need to blink LED once(pin 13) for 1 S. but still push button should be pressed.

Here is my code. it is not working. please help me to do my project.


int ledPin = 13;
volatile int buttonState = LOW;

void setup() {

pinMode(ledPin, OUTPUT);

//Attach the Interrupt
attachInterrupt(0, InterruptMenu, RISING); // INTERRUPT PIN 2 for UNO
}
void loop(){
if (buttonState == HIGH)
{
digitalWrite(ledPin, buttonState);
delay(1000);
buttonState = LOW;
}
}

//Interrupt Function
void InterruptMenu()
{ if(buttonState == 0)
{
buttonState = !buttonState;
}
}

hi- im new for this forum--
sry for post here - how can i add new post /topic problem - ???

i want to know how to first setup enc28j60 module

@udrkapuduwa
You don't need to use an interrupt to do this.
Is this an assignment and are you forced to use interrupts?

@rohanth
Click the new topic button in the top right hand corner of the forum you want.

udrkapuduwa:
Here is my code. it is not working. please help me to do my project.

OK, first and most critical thing to do (especial if you are new to this) is to forget any code to do with interrupts, and start by figuring out how you need to approach the problem - make a list of steps and work through them.

When you have a rough code to do it (read through a lot of other similar discussions), post it using the "code" tags generated by the [ # ] button above the submission window.