From 40e28a2fdc7b73d68cc46688e20174969b36a6e3 Mon Sep 17 00:00:00 2001 From: Nicholas Humfrey Date: Sat, 28 Jul 2018 12:17:39 +0100 Subject: [PATCH] Added comment to each of the examples about the Slave Select pin "Change 'SS' to your Slave Select pin, if you aren't using the default pin" --- examples/JeeUdp/JeeUdp.ino | 4 +++- examples/SSDP/SSDP.ino | 3 ++- examples/backSoon/backSoon.ino | 3 ++- examples/etherNode/etherNode.ino | 3 ++- examples/getDHCPandDNS/getDHCPandDNS.ino | 3 ++- examples/getStaticIP/getStaticIP.ino | 3 ++- examples/getViaDNS/getViaDNS.ino | 3 ++- examples/multipacket/multipacket.ino | 4 +++- examples/multipacketSD/multipacketSD.ino | 4 +++- examples/nanether/nanether.ino | 4 +++- examples/noipClient/noipClient.ino | 1 + examples/notifyMyAndroid/notifyMyAndroid.ino | 3 ++- examples/ntpClient/ntpClient.ino | 3 ++- examples/persistence/persistence.ino | 4 ++-- examples/pings/pings.ino | 3 ++- examples/rbbb_server/rbbb_server.ino | 3 ++- examples/stashTest/stashTest.ino | 4 +++- examples/testDHCP/testDHCP.ino | 3 ++- examples/thingspeak/thingspeak.ino | 4 ++-- examples/twitter/twitter.ino | 3 ++- examples/udpClientSendOnly/udpClientSendOnly.ino | 3 ++- examples/udpListener/udpListener.ino | 3 ++- examples/webClient/webClient.ino | 3 ++- examples/xively/xively.ino | 3 ++- 24 files changed, 52 insertions(+), 25 deletions(-) diff --git a/examples/JeeUdp/JeeUdp.ino b/examples/JeeUdp/JeeUdp.ino index cd91c43..b44afd9 100644 --- a/examples/JeeUdp/JeeUdp.ino +++ b/examples/JeeUdp/JeeUdp.ino @@ -77,7 +77,9 @@ void setup (){ Serial.begin(57600); Serial.println("\n[JeeUdp]"); loadConfig(); - if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) + + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) Serial.println( "Failed to access Ethernet controller"); if (!ether.dhcpSetup()) Serial.println("DHCP failed"); diff --git a/examples/SSDP/SSDP.ino b/examples/SSDP/SSDP.ino index 57eccc1..8d674c6 100644 --- a/examples/SSDP/SSDP.ino +++ b/examples/SSDP/SSDP.ino @@ -53,7 +53,8 @@ const char pageD[] PROGMEM = ; void setup(){ - ether.begin(sizeof Ethernet::buffer, mymac , SS);// SS = 53 for the mega ethernet shield and 10 for normal ethernet shield + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + ether.begin(sizeof Ethernet::buffer, mymac, SS); ether.staticSetup(myip, gwip); ENC28J60::disableMulticast(); //disable multicast filter means enable multicast reception Serial.begin(115200); diff --git a/examples/backSoon/backSoon.ino b/examples/backSoon/backSoon.ino index 9d49cae..ac62ed8 100644 --- a/examples/backSoon/backSoon.ino +++ b/examples/backSoon/backSoon.ino @@ -40,7 +40,8 @@ void setup(){ Serial.begin(57600); Serial.println("\n[backSoon]"); - if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) Serial.println( "Failed to access Ethernet controller"); #if STATIC ether.staticSetup(myip, gwip); diff --git a/examples/etherNode/etherNode.ino b/examples/etherNode/etherNode.ino index 46d764c..716ce46 100644 --- a/examples/etherNode/etherNode.ino +++ b/examples/etherNode/etherNode.ino @@ -80,7 +80,8 @@ void setup(){ #endif loadConfig(); - if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) Serial.println( "Failed to access Ethernet controller"); if (!ether.dhcpSetup()) Serial.println("DHCP failed"); diff --git a/examples/getDHCPandDNS/getDHCPandDNS.ino b/examples/getDHCPandDNS/getDHCPandDNS.ino index ee1aacc..9981128 100644 --- a/examples/getDHCPandDNS/getDHCPandDNS.ino +++ b/examples/getDHCPandDNS/getDHCPandDNS.ino @@ -25,7 +25,8 @@ void setup () { Serial.begin(57600); Serial.println("\n[getDHCPandDNS]"); - if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) Serial.println( "Failed to access Ethernet controller"); if (!ether.dhcpSetup()) diff --git a/examples/getStaticIP/getStaticIP.ino b/examples/getStaticIP/getStaticIP.ino index 4eb9234..e25f0b2 100644 --- a/examples/getStaticIP/getStaticIP.ino +++ b/examples/getStaticIP/getStaticIP.ino @@ -31,7 +31,8 @@ void setup () { Serial.begin(57600); Serial.println("\n[getStaticIP]"); - if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) Serial.println( "Failed to access Ethernet controller"); ether.staticSetup(myip, gwip); diff --git a/examples/getViaDNS/getViaDNS.ino b/examples/getViaDNS/getViaDNS.ino index fced057..66a50f4 100644 --- a/examples/getViaDNS/getViaDNS.ino +++ b/examples/getViaDNS/getViaDNS.ino @@ -29,7 +29,8 @@ void setup () { Serial.begin(57600); Serial.println("\n[getViaDNS]"); - if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) Serial.println( "Failed to access Ethernet controller"); ether.staticSetup(myip, gwip); diff --git a/examples/multipacket/multipacket.ino b/examples/multipacket/multipacket.ino index ebe746b..3f09a14 100644 --- a/examples/multipacket/multipacket.ino +++ b/examples/multipacket/multipacket.ino @@ -47,9 +47,11 @@ const char pageE[] PROGMEM = void setup(){ - ether.begin(sizeof Ethernet::buffer, mymac , 10);// 53 for the mega ethernet shield and 10 for normal ethernet shield + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + ether.begin(sizeof Ethernet::buffer, mymac , SS); ether.staticSetup(myip, gwip); } + void loop(){ word pos = ether.packetLoop(ether.packetReceive()); // check if valid tcp data is received diff --git a/examples/multipacketSD/multipacketSD.ino b/examples/multipacketSD/multipacketSD.ino index 41b93cd..f76260f 100644 --- a/examples/multipacketSD/multipacketSD.ino +++ b/examples/multipacketSD/multipacketSD.ino @@ -30,7 +30,9 @@ void setup() { file.setSSpin(4); res=file.initFAT(0); if (res==NO_ERROR) Serial.println("SD started"); - ether.begin(sizeof Ethernet::buffer, mymac , SS); //SS = 53 on mega ethernet shield 10 on others + + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + ether.begin(sizeof Ethernet::buffer, mymac , SS); ether.staticSetup(myip, gwip); Serial.println("ETH started"); } diff --git a/examples/nanether/nanether.ino b/examples/nanether/nanether.ino index 250b50c..575c4f4 100644 --- a/examples/nanether/nanether.ino +++ b/examples/nanether/nanether.ino @@ -20,7 +20,9 @@ void setup(void) /* Check that the Ethernet controller exists */ Serial.println("Initialising the Ethernet controller"); - if (ether.begin(sizeof Ethernet::buffer, mac, 8) == 0) { + + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + if (ether.begin(sizeof Ethernet::buffer, mac, SS) == 0) { Serial.println( "Ethernet controller NOT initialised"); while (true) /* MT */ ; diff --git a/examples/noipClient/noipClient.ino b/examples/noipClient/noipClient.ino index 2c7c495..01d2310 100644 --- a/examples/noipClient/noipClient.ino +++ b/examples/noipClient/noipClient.ino @@ -54,6 +54,7 @@ void setup () { Serial.println(F("NoIP Client Demo")); Serial.println(); + // Change 'SS' to your Slave Select pin, if you arn't using the default pin if (!ether.begin(sizeof Ethernet::buffer, mymac, SS)) Serial.println(F( "Failed to access Ethernet controller")); else diff --git a/examples/notifyMyAndroid/notifyMyAndroid.ino b/examples/notifyMyAndroid/notifyMyAndroid.ino index 6ab529d..752e3ef 100644 --- a/examples/notifyMyAndroid/notifyMyAndroid.ino +++ b/examples/notifyMyAndroid/notifyMyAndroid.ino @@ -56,7 +56,8 @@ void setup () { Serial.begin(57600); Serial.println("\nStarting Notify My Android Example"); - if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) Serial.println(F("Failed to access Ethernet controller")); if (!ether.dhcpSetup()) Serial.println(F("DHCP failed")); diff --git a/examples/ntpClient/ntpClient.ino b/examples/ntpClient/ntpClient.ino index 80d38f4..76908f2 100644 --- a/examples/ntpClient/ntpClient.ino +++ b/examples/ntpClient/ntpClient.ino @@ -29,7 +29,8 @@ void setup() { Serial.begin(9600); Serial.println(F("\n[EtherCard NTP Client]")); - if (ether.begin(sizeof Ethernet::buffer, myMac) == 0) + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + if (ether.begin(sizeof Ethernet::buffer, myMac, SS) == 0) Serial.println(F("Failed to access Ethernet controller")); if (!ether.dhcpSetup()) Serial.println(F("DHCP failed")); diff --git a/examples/persistence/persistence.ino b/examples/persistence/persistence.ino index 98bf133..75eca4d 100644 --- a/examples/persistence/persistence.ino +++ b/examples/persistence/persistence.ino @@ -44,8 +44,8 @@ void setup () { Serial.begin(57600); Serial.println(F("\n[Persistence+readPacketSlice]")); - - if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) Serial.println(F("Failed to access Ethernet controller")); if (!ether.dhcpSetup()) Serial.println(F("DHCP failed")); diff --git a/examples/pings/pings.ino b/examples/pings/pings.ino index f35c73a..5656297 100644 --- a/examples/pings/pings.ino +++ b/examples/pings/pings.ino @@ -18,7 +18,8 @@ void setup () { Serial.begin(57600); Serial.println("\n[pings]"); - if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) Serial.println(F("Failed to access Ethernet controller")); if (!ether.dhcpSetup()) Serial.println(F("DHCP failed")); diff --git a/examples/rbbb_server/rbbb_server.ino b/examples/rbbb_server/rbbb_server.ino index 0e602ad..81037c2 100644 --- a/examples/rbbb_server/rbbb_server.ino +++ b/examples/rbbb_server/rbbb_server.ino @@ -11,7 +11,8 @@ byte Ethernet::buffer[500]; BufferFiller bfill; void setup () { - if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) Serial.println(F("Failed to access Ethernet controller")); ether.staticSetup(myip); } diff --git a/examples/stashTest/stashTest.ino b/examples/stashTest/stashTest.ino index ed847d2..d41d2ca 100644 --- a/examples/stashTest/stashTest.ino +++ b/examples/stashTest/stashTest.ino @@ -46,7 +46,9 @@ void dumpStash (const char* msg, void* ptr) { void setup () { Serial.begin(57600); Serial.println("\n[stashTest]"); - ether.begin(sizeof Ethernet::buffer, mymac); + + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + ether.begin(sizeof Ethernet::buffer, mymac, SS); #if 1 Stash buf; diff --git a/examples/testDHCP/testDHCP.ino b/examples/testDHCP/testDHCP.ino index 5545894..53811f4 100644 --- a/examples/testDHCP/testDHCP.ino +++ b/examples/testDHCP/testDHCP.ino @@ -24,7 +24,8 @@ void setup () { } Serial.println(); - if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) Serial.println(F("Failed to access Ethernet controller")); Serial.println(F("Setting up DHCP")); diff --git a/examples/thingspeak/thingspeak.ino b/examples/thingspeak/thingspeak.ino index e7f1b81..da386b7 100644 --- a/examples/thingspeak/thingspeak.ino +++ b/examples/thingspeak/thingspeak.ino @@ -15,7 +15,6 @@ // change these settings to match your own setup //#define FEED "000" #define APIKEY "beef1337beef1337" // put your key here -#define ethCSpin 10 // put your CS/SS pin here. // ethernet interface mac address, must be unique on the LAN static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; @@ -123,7 +122,8 @@ void initialize_ethernet(void){ //digitalWrite(5, HIGH); //delay(500); - if (ether.begin(sizeof Ethernet::buffer, mymac, ethCSpin) == 0){ + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0){ Serial.println( "Failed to access Ethernet controller"); continue; } diff --git a/examples/twitter/twitter.ino b/examples/twitter/twitter.ino index e94c681..32d0933 100644 --- a/examples/twitter/twitter.ino +++ b/examples/twitter/twitter.ino @@ -57,7 +57,8 @@ void setup () { Serial.begin(57600); Serial.println("\n[Twitter Client]"); - if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) Serial.println(F("Failed to access Ethernet controller")); if (!ether.dhcpSetup()) Serial.println(F("DHCP failed")); diff --git a/examples/udpClientSendOnly/udpClientSendOnly.ino b/examples/udpClientSendOnly/udpClientSendOnly.ino index 9acd0a8..feda2d9 100644 --- a/examples/udpClientSendOnly/udpClientSendOnly.ino +++ b/examples/udpClientSendOnly/udpClientSendOnly.ino @@ -12,7 +12,8 @@ const int srcPort PROGMEM = 4321; void setup () { Serial.begin(9600); - if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) Serial.println( "Failed to access Ethernet controller"); if (!ether.dhcpSetup()) Serial.println("DHCP failed"); diff --git a/examples/udpListener/udpListener.ino b/examples/udpListener/udpListener.ino index 6722495..40c5122 100644 --- a/examples/udpListener/udpListener.ino +++ b/examples/udpListener/udpListener.ino @@ -40,7 +40,8 @@ void setup(){ Serial.begin(57600); Serial.println(F("\n[backSoon]")); - if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) Serial.println(F("Failed to access Ethernet controller")); #if STATIC ether.staticSetup(myip, gwip); diff --git a/examples/webClient/webClient.ino b/examples/webClient/webClient.ino index ebde8e1..4bce5c2 100644 --- a/examples/webClient/webClient.ino +++ b/examples/webClient/webClient.ino @@ -23,7 +23,8 @@ void setup () { Serial.begin(57600); Serial.println(F("\n[webClient]")); - if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0) Serial.println(F("Failed to access Ethernet controller")); if (!ether.dhcpSetup()) Serial.println(F("DHCP failed")); diff --git a/examples/xively/xively.ino b/examples/xively/xively.ino index 6b2eca6..08a049a 100644 --- a/examples/xively/xively.ino +++ b/examples/xively/xively.ino @@ -113,7 +113,8 @@ void initialize_ethernet(void){ digitalWrite(5, HIGH); delay(500); - if (ether.begin(sizeof Ethernet::buffer, mymac) == 0){ + // Change 'SS' to your Slave Select pin, if you arn't using the default pin + if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0){ Serial.println( "Failed to access Ethernet controller"); continue; }