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(){
}
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...