Moderators: adafruit_support_bill, adafruit
To match the SPI bus that the ethernet (and other SPI devices) will use, I would try changing it to the following (make sure the hardware wiring changes to match):
#define OLED_MOSI 11
#define OLED_CLK 13
#define OLED_CS 9
#define OLED_DC 8
#define OLED_RESET 7
The communication protocol is indeed SPI, however. It is simply implemented as software SPI in the adafruit library, and you can use any set of free pins to drive the display - it's not limited to using the hardware SPI pins.
The SPI bus specifies four logic signals: SCLK, MOSI, MISO, and SS
void setup() {
Serial.begin(9600);
// This is where the display is initialized
display.begin(SSD1306_SWITCHCAPVCC);
// init done
display.clearDisplay();
display.display(); // show splashscreen
delay(2000);
// text display tests
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0,0);
display.println("Please wait.");
display.println("Rebooting...");
display.display();
delay(5000);
int i = 0;
int DHCP = 0;
Serial.println("After serial begin");
DHCP = Ethernet.begin(mac);
//Try to get dhcp settings 30 times before giving up
while( DHCP == 0 && i < 30){
delay(1000);
DHCP = Ethernet.begin(mac);
i++;
Serial.println("DHCP attempt ");
}
if(!DHCP){
Serial.println("DHCP FAILED");
for(;;); //Infinite loop because DHCP Failed
}
Serial.println("DHCP Success");
/***/gwilson5 wrote:That is where it all comes to a halt.
DHCP = Ethernet.begin(mac);NB: Pins 10, 11, 12 and 13 are reserved for interfacing with the Ethernet module and should not be used otherwise.
gwilson5 wrote:However, I just read this on the product page on Arduino website:
NB: Pins 10, 11, 12 and 13 are reserved for interfacing with the Ethernet module and should not be used otherwise.
gwilson5 wrote:now I only have 2 digital pins for my project.
Users browsing this forum: ArekKindAcere, Google [Bot] and 9 guests