Guest User

Untitled

a guest
Sep 29th, 2020
124
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  *  Arduino sketch pro ESP8266 (MeteoV4.1) s ePaper cenovkou 2.9" b/w/r nebo
  3.  *  4" b/w/r
  4.  *  
  5.  *  Potrebne knihovny:
  6.  *  ePaper: https://github.com/ZinggJM/GxEPD
  7.  *  ESP8266: https://github.com/esp8266/Arduino
  8.  *  
  9.  *  Upravil: Petr Sramek (@chiptronCZ)
  10.  */
  11.  
  12. #include <GxEPD.h>
  13. #include <Fonts/FreeMonoBold9pt7b.h>
  14.  
  15. // select the display class to use, only one, copy from GxEPD_Example
  16. #include <GxGDEW029Z10/GxGDEW029Z10.h>    // 2.9" b/w/r
  17. //#include <GxGDEW042Z15/GxGDEW042Z15.h>    // 4.2" b/w/r
  18.  
  19. #include <GxIO/GxIO_SPI/GxIO_SPI.h>
  20. #include <GxIO/GxIO.h>
  21.  
  22. // constructor for ESP8266, copy from GxEPD_Example else
  23. GxIO_Class io(SPI, /*CS=*/ 15, /*DC=*/ 0, /*RST=*/ 2); // arbitrary selection of 8, 9 selected for default of GxEPD_Class
  24. GxEPD_Class display(io, /*RST=*/ 2, /*BUSY=*/ 12); // default selection of (9), 7
  25.  
  26. const char* name = "FreeMonoBold9pt7b";
  27. const GFXfont* f = &FreeMonoBold9pt7b;
  28.  
  29. void setup()
  30. {
  31.   Serial.begin(115200);
  32.  
  33.   display.init();
  34.   display.setRotation(0);
  35.   Serial.println("Erase display");
  36.   display.eraseDisplay();
  37.   display.fillScreen(GxEPD_WHITE);
  38.   display.setTextColor(GxEPD_BLACK);
  39.   display.setFont(f);
  40.   display.setCursor(0, 20);
  41.   Serial.println("Write");
  42.   display.println("Bastlirsky pokec");
  43.   display.setTextColor(GxEPD_RED);
  44.   display.println("@KutilDomaci a @chiptronCZ");  
  45.   display.update();
  46.   Serial.println("Finished");
  47. }
  48.  
  49. void loop()
  50. {
  51.  
  52. }
RAW Paste Data