help with ENC28J60

im using ENC28J60 module ryt now… after i compile my sketch below(an edited sample sketch)… nothing happens… i guess my module is not compatible with the latest library i am using in this sketch ryt? could anyone help me what to do?

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

int Pin = 7;
int Pin1 = 6;
// Enter a MAC address, IP address and Portnumber for your Server below.
// The IP address will be dependent on your local network:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress serverIP(192,168,1,15);
int serverPort=80;
//int servoPin=3;

// Initialize the Ethernet server library
// with the IP address and port you entered
EthernetServer server(serverPort);

//Initialise the Servo Library
//Servo myservo;

//used to store the old value of my poti to check changes
int oldPotiValue=0;

void setup()
{
  // start the serial for debugging
  Serial.begin(9600);
  // start the Ethernet connection and the server:
  Ethernet.begin(mac, serverIP);
  server.begin();
  Serial.println("Server started");//debug

  pinMode(Pin ,OUTPUT);
  pinMode(Pin1 ,OUTPUT);

  //myservo.attach(servoPin);  // attach the servo on the servoPin you entered
}

void loop()
{
  // listen for incoming clients
  EthernetClient client = server.available();
  if (client) {
    String commandStr ="";//Commandstring where incoming commands are stored

    while (client.connected()) {//if a client is connected
      //int curPotiValue = analogRead(A0);//reads the Poti
      //checks if the value of the poti has changed +-2
     /* if(curPotiValue>(oldPotiValue+2) || curPotiValue<(oldPotiValue-2)){
          Serial.println("Poti has Changed:"+String(curPotiValue));
          server.println("setPoti:"+String(curPotiValue));//broadcast the value
          oldPotiValue=curPotiValue;//set the old value to the new one
      }*/
     /* if (client.available()) {//if client is sending
        //reading the inputs from the client
        char c = client.read();
        commandStr+=c;//and ands them to the command String

        if (c == '\n') {//if a newline character is sent (commandline is fully recieved)
          Serial.println("Command:"+commandStr);//output the command
          if(commandStr.indexOf("set:")==0){//if the command begins with "set:"
            String value=commandStr;//store the command into a new String
            value.replace("set:", ""); //remove the "set:" from the command string
            Serial.println("Set a Servo:"+value);//output the servo value
            myservo.write(convertToInt(value));//set the servo to the recieved value
            server.println("setServo:"+value);
          }
          commandStr="";//reset the commandline String
        }
      }*/
    if (client.available()) {//if client is sending
    //reading the inputs from the client
    char c = client.read();
    commandStr+=c;//and ands them to the command String

    if (c == '&') {//if a newline character is sent (commandline is fully recieved)
      Serial.println("Command:"+commandStr);//output the command
      if(commandStr.equals("A0&")){//if the command begins with "set:"
        digitalWrite(Pin , LOW);//dri na tong cmd para sa pag off sa relay A
      }
      if(commandStr.equals("B0&")){//if the command begins with "set:"
         digitalWrite(Pin1 , LOW); //dri na tong cmd para sa pag off sa relay B
      }
      if(commandStr.equals("A1&")){//if the command begins with "set:"
         digitalWrite(Pin , HIGH); //dri na tong cmd para sa pag on sa relay A
      }
      if(commandStr.equals("B1&")){//if the command begins with "set:"
         digitalWrite(Pin1 , HIGH); //dri na tong cmd para sa pag on sa relay B
      }
      commandStr="";//reset the commandline String
    }
  }
  

    }
    
    // give the client time to receive the data
    delay(1);
    // close the connection:
    client.stop();
  }
}

//method can convert a String (not char[]!) to an integer
int convertToInt(String value){
  char buf[value.length()];
  value.toCharArray(buf,value.length());
  return atoi(buf);
}

It won't work with the standard Ethernet library. You need to go search for the ENC28J60 library.

You need to go search for the ENC28J60 library.

Or the (better) EtherCard library.

PaulS:

You need to go search for the ENC28J60 library.

Or the (better) EtherCard library.

i already add the ethercard library from https://github.com/jcw/ethercard can you help to what will i change in my sketch because im really confused with the new codes such us the #include.h etc.. plss i just want to get my project working..

plss i just want to get my project working.

if you can afford $11, then get a w5100 based board from ebay. The ENC28J60 programming appears to be best suited for advanced programmers.

http://www.ebay.com/itm/Ethernet-Shield-W5100-For-Arduino-2009-UNO-Mega-1280-2560-/170848101688?pt=LH_DefaultDomain_0&hash=item27c7572538