Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // GxEPD_MinimumExample by Jean-Marc Zingg
- #include <GxEPD.h>
- #include <Fonts/FreeMonoBold9pt7b.h>
- // select the display class to use, only one, copy from GxEPD_Example
- //#include <GxGDEH0154D67/GxGDEH0154D67.h> // 1.54" b/w
- #include <GxGDEW042Z15/GxGDEW042Z15.h> // 4.2" b/w/r
- #include <GxIO/GxIO_SPI/GxIO_SPI.h>
- #include <GxIO/GxIO.h>
- // constructor for AVR Arduino, copy from GxEPD_Example else
- GxIO_Class io(SPI, /*CS=*/ 10, /*DC=*/ 9, /*RST=*/ 8); // arbitrary selection of 8, 9 selected for default of GxEPD_Class
- GxEPD_Class display(io, /*RST=*/ 8, /*BUSY=*/ 7); // default selection of (9), 7
- const char* name = "FreeMonoBold12pt7b";
- const GFXfont* f = &FreeMonoBold12pt7b;
- void setup()
- {
- Serial.begin(115200);
- Serial.println("Start init...");
- display.init();
- display.setRotation(2);
- Serial.println("Erase display...");
- display.eraseDisplay();
- // comment out next line to have no or minimal Adafruit_GFX code
- Serial.println("Draw Hello World...");
- display.drawPaged(drawHelloWorld); // version for AVR using paged drawing, works also on other processors
- Serial.println("Finished!");
- }
- void drawHelloWorld()
- {
- display.setFont(f);
- display.setTextColor(GxEPD_BLACK);
- display.setCursor(0,20);
- display.print("Bastlirsky pokec");
- display.setTextColor(GxEPD_RED);
- display.setCursor(0,40);
- display.print("ePaper Special");
- }
- void loop() {};
Advertisement
Add Comment
Please, Sign In to add comment