Ethernet - Ethernet.init()

Description

Used to configure the CS (chip select) pin for the Ethernet controller chip. The Ethernet library has a default CS pin, which is usually correct, but with some non-standard Ethernet hardware you might need to use a different CS pin.

Syntax

Ethernet.init(sspin)

Parameters

  • sspin: the pin number to use for CS (byte)

Returns

Nothing

Example

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

byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(10, 0, 0, 177);

void setup() {
  Ethernet.init(53);  // use pin 53 for Ethernet CS
  Ethernet.begin(mac, ip);
}

void loop () {}