attachInterrupt() and Ethernet.begin() not working together [SOLVED]

hi all..
im new for arduino uno with ethernet shield and c code...
check the following code please.
when i disable to Ethernet.begin(mac, ip) (//Ethernet.begin(mac, ip)), attachInterrupt() working.
also attachInterrupt() now work.
why?
thank you for all..
Best Regards

#include <SPI.h>
#include <Ethernet.h>

int buttonPin = 2;
int elektrik =13;

byte mac[] = {0xDE,0xAC,0xBF,0xEF,0xFE,0xAA};
byte ip[]= {10,16,102,228};

void setup() {
Ethernet.begin(mac, ip); // when i disable interrupt working
      
pinMode(buttonPin, INPUT); 
pinMode (elektrik, OUTPUT); 
digitalWrite (elektrik, HIGH);   
attachInterrupt (0, alper, CHANGE);

}

void alper ()
{
 
if (digitalRead (buttonPin) == HIGH)
digitalWrite (elektrik, HIGH);
delay(2500);
digitalWrite (elektrik, LOW);

} 


void loop(){

}

[SOLITION]my last post:
why dosent work?
because, ethernet using pins of (10,11,12,13)th. i change 13 of output. i set 7 for output...
http://arduino.cc/en/Main/arduinoBoardEthernet

You can't use delay in an ISR.

Mark

Thank for your answer Mark...

i removed delay funtion from ISR.
and added something. but dosent work... :frowning: check the following please..
(also disable ethernet.begin work again.)

best regards...

#include <SPI.h>
#include <Ethernet.h>

int buttonPin = 2;
int elektrik =13;

byte mac[] = {0xDE,0xAC,0xBF,0xEF,0xFE,0xAA};
byte ip[]= {10,16,102,228};

void setup() {
Ethernet.begin(mac, ip); 
      
pinMode(buttonPin, INPUT); 
pinMode (elektrik, OUTPUT); 
digitalWrite (elektrik, HIGH);   
attachInterrupt (0, alper, CHANGE);
attachInterrupt (1, gokcen, CHANGE);

}

void alper ()
{
 
if (digitalRead (buttonPin) == HIGH)
digitalWrite (elektrik, HIGH);
gokcen();

} 

void gokcen ()
{
 
if (digitalRead (buttonPin) == LOW)
digitalWrite (elektrik, LOW);


} 


void loop(){

}

Hi all again...
its working with relay() function.
Ethernet using pins of (10,11,12,13)th. i change 13 of output. i set 7 for output...
thank for all
Best Regards...

Why are you using interrupts at all? What is connected to the two external interrupt pins?