|
@ -8,7 +8,36 @@ |
|
|
#include <WiFi.h> |
|
|
#include <WiFi.h> |
|
|
#include <WiFiMulti.h> |
|
|
#include <WiFiMulti.h> |
|
|
|
|
|
|
|
|
|
|
|
#include <GxEPD2_BW.h> |
|
|
|
|
|
#include <Fonts/FreeMonoBold9pt7b.h> |
|
|
|
|
|
#include "bitmaps/Bitmaps128x250.h" |
|
|
|
|
|
|
|
|
WiFiMulti wifiMulti; |
|
|
WiFiMulti wifiMulti; |
|
|
|
|
|
GxEPD2_BW<GxEPD2_213_B72, GxEPD2_213_B72::HEIGHT> display(GxEPD2_213_B72(/*CS=TFT_CS*/ SS, /*DC=*/ TFT_DC, /*RST=*/ TFT_RST, /*BUSY=*/ -1)); // GDEH0213B72
|
|
|
|
|
|
|
|
|
|
|
|
void helloWorld() |
|
|
|
|
|
{ |
|
|
|
|
|
const char HelloWorld[] = "Hello World!"; |
|
|
|
|
|
//Serial.println("helloWorld");
|
|
|
|
|
|
display.setRotation(1); |
|
|
|
|
|
display.setFont(&FreeMonoBold9pt7b); |
|
|
|
|
|
display.setTextColor(GxEPD_BLACK); |
|
|
|
|
|
int16_t tbx, tby; uint16_t tbw, tbh; |
|
|
|
|
|
display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh); |
|
|
|
|
|
// center bounding box by transposition of origin:
|
|
|
|
|
|
uint16_t x = ((display.width() - tbw) / 2) - tbx; |
|
|
|
|
|
uint16_t y = ((display.height() - tbh) / 2) - tby; |
|
|
|
|
|
display.setFullWindow(); |
|
|
|
|
|
display.firstPage(); |
|
|
|
|
|
do |
|
|
|
|
|
{ |
|
|
|
|
|
display.fillScreen(GxEPD_WHITE); |
|
|
|
|
|
display.setCursor(x, y); |
|
|
|
|
|
display.print(HelloWorld); |
|
|
|
|
|
} |
|
|
|
|
|
while (display.nextPage()); |
|
|
|
|
|
//Serial.println("helloWorld done");
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void setup() |
|
|
void setup() |
|
|
{ |
|
|
{ |
|
@ -17,6 +46,10 @@ void setup() |
|
|
// initialize LED digital pin as an output.
|
|
|
// initialize LED digital pin as an output.
|
|
|
pinMode(LED_BUILTIN, OUTPUT); |
|
|
pinMode(LED_BUILTIN, OUTPUT); |
|
|
|
|
|
|
|
|
|
|
|
display.init(115200); |
|
|
|
|
|
helloWorld(); |
|
|
|
|
|
display.powerOff(); |
|
|
|
|
|
|
|
|
wifiMulti.addAP(WIFI_SSID, WIFI_PASSWD); |
|
|
wifiMulti.addAP(WIFI_SSID, WIFI_PASSWD); |
|
|
wifiMulti.addAP(WIFI_SSID2, WIFI_PASSWD2); |
|
|
wifiMulti.addAP(WIFI_SSID2, WIFI_PASSWD2); |
|
|
|
|
|
|
|
|