I'm new here and have a question
I have connected the WaveShare 1.54" ePaper Display to a ESP-12F (NodeMCU) according to the schematic.
BUSY->D6(MISO), RST->D4, DC->D3, CS->D8(SS), CLK->D5(SCK), DIN->D7(MOSI), GND->GNG, 3.3V->3.3V
My sample code(see below) only works, if I disconnect pin D8 (CS) during startup of the Board (after pressing Reset) and reconnect it afterwards. If I leave it connected and try to reset the board, I only get
ets Jan 8 2013,rst cause:2, boot mode:(7,6)
waiting for host
in the Serial Monitor. What could be the problem here? I already tried a beefy power supply, but that doesn't make any difference. Maybe you can help me
Here is the Code:
#include <GxEPD.h>
#include <GxGDEP015OC1/GxGDEP015OC1.cpp> // for the 1.54 inch display module
#include <GxIO/GxIO_SPI/GxIO_SPI.cpp>
#include <GxIO/GxIO.cpp>
// ESP8266 generic/common.h
//static const uint8_t SS = 15;
//static const uint8_t MOSI = 13;
//static const uint8_t SCK = 14;
GxIO_Class io(SPI, SS/* CS */, D3/* DC */, D4/* RST */);
GxEPD_Class display(io, /*RST=D4*/ 2, /*BUSY=D2*/ -1);
// FreeFonts from Adafruit_GFX
#include <Fonts/FreeSansBold12pt7b.h>
#include <Fonts/FreeSansBold18pt7b.h>
#include <Fonts/FreeSansBold24pt7b.h>
int counter = 100;
void setup()
{
delay(1000);
Serial.begin(115200);
while (!Serial) { }
Serial.println();
Serial.println("setup");
delay(1000);
SPI.setFrequency(8000000L);
display.init();
}
void loop()
{
sendUpdateBME280();
delay(10000);
}
void sendUpdateBME280()
{
Serial.println("Update");
delay(1000);
uint16_t middleY = display.height() / 2;
display.setRotation(1);
display.fillScreen(GxEPD_WHITE);
display.setTextColor(GxEPD_BLACK);
display.setFont(&FreeSansBold24pt7b);
display.setTextSize(2);
display.setCursor(8, 72);
display.print(counter, 1);
display.update();
counter++;
}