Skip to content

Instantly share code, notes, and snippets.

@jancumps
Created September 8, 2019 11:15
Show Gist options
  • Select an option

  • Save jancumps/410793d712195463f294c2ff78acb55c to your computer and use it in GitHub Desktop.

Select an option

Save jancumps/410793d712195463f294c2ff78acb55c to your computer and use it in GitHub Desktop.
#include <SPI.h>
#include <Ethernet.h>
void setup() {
/* https://www.arduino.cc/en/Guide/MKRETHShield
* As the W5500 and SD card share the SPI bus,
* only one at a time can be active.
* If you are using both peripherals in your program, this should be taken care of by the corresponding libraries.
* If you're not using one of the peripherals in your program, however, you'll need to explicitly deselect it.
* To do this with the SD card, set pin 4 as an output and write a high to it.
* For the W5500, set digital pin 5 as a high output.
*/
pinMode(4, OUTPUT);
digitalWrite(4, HIGH);
Ethernet.init(5); // MKR ETH shield
// ....
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment