Skip to content

Commit

Permalink
Added comment to each of the examples about the Slave Select pin (#321)
Browse files Browse the repository at this point in the history
"Change 'SS' to your Slave Select pin, if you aren't using the default pin"
  • Loading branch information
njh authored Jul 28, 2018
1 parent 4a8d835 commit 6c0c5b3
Show file tree
Hide file tree
Showing 24 changed files with 52 additions and 25 deletions.
4 changes: 3 additions & 1 deletion examples/JeeUdp/JeeUdp.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
3 changes: 2 additions & 1 deletion examples/SSDP/SSDP.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion examples/backSoon/backSoon.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion examples/etherNode/etherNode.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
3 changes: 2 additions & 1 deletion examples/getDHCPandDNS/getDHCPandDNS.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
3 changes: 2 additions & 1 deletion examples/getStaticIP/getStaticIP.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion examples/getViaDNS/getViaDNS.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion examples/multipacket/multipacket.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion examples/multipacketSD/multipacketSD.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
4 changes: 3 additions & 1 deletion examples/nanether/nanether.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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 */ ;
Expand Down
1 change: 1 addition & 0 deletions examples/noipClient/noipClient.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion examples/notifyMyAndroid/notifyMyAndroid.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
3 changes: 2 additions & 1 deletion examples/ntpClient/ntpClient.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
4 changes: 2 additions & 2 deletions examples/persistence/persistence.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
3 changes: 2 additions & 1 deletion examples/pings/pings.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
3 changes: 2 additions & 1 deletion examples/rbbb_server/rbbb_server.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 3 additions & 1 deletion examples/stashTest/stashTest.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion examples/testDHCP/testDHCP.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
4 changes: 2 additions & 2 deletions examples/thingspeak/thingspeak.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down Expand Up @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion examples/twitter/twitter.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
3 changes: 2 additions & 1 deletion examples/udpClientSendOnly/udpClientSendOnly.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
3 changes: 2 additions & 1 deletion examples/udpListener/udpListener.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion examples/webClient/webClient.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
3 changes: 2 additions & 1 deletion examples/xively/xively.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6c0c5b3

Please sign in to comment.