-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheapYellowLCD.cpp
More file actions
53 lines (45 loc) · 1.64 KB
/
Copy pathcheapYellowLCD.cpp
File metadata and controls
53 lines (45 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// WiFiManager (via WebServer.h) needs the global FS/File aliases from FS.h,
// but TFT_eSPI includes FS.h with FS_NO_GLOBALS when SMOOTH_FONT is enabled.
// WiFiManager must therefore be included before cheapYellowLCD.h (TFT_eSPI).
#include <WiFi.h>
#include <WiFiManager.h>
#include "cheapYellowLCD.h"
#include "logBuffer.h"
TFT_eSPI tft = TFT_eSPI();
void CheapYellowDisplay::displaySetup()
{
Log.println("cyd display setup");
setWidth(320);
setHeight(240);
// Start the tft display and set it to black
tft.init();
tft.setRotation(1);
tft.fillScreen(TFT_BLACK);
tft.setTextFont(2);
tft.setTextSize(2);
tft.setTextDatum(MC_DATUM);
tft.setTextColor(TFT_WHITE, TFT_BLACK);
tft.drawString("System initializing...", 160, 120);
}
void CheapYellowDisplay::drawWifiManagerMessage(WiFiManager *myWiFiManager)
{
tft.setTextFont(1);
tft.setTextSize(1);
tft.setTextDatum(TL_DATUM);
Log.println("Entered Conf Mode");
tft.fillScreen(TFT_BLACK);
tft.setTextColor(TFT_WHITE, TFT_BLACK);
tft.drawCentreString("Entered Conf Mode:", screenCenterX, 5, 2);
tft.drawString("Connect to the following WIFI AP:", 5, 28, 2);
tft.setTextColor(TFT_BLUE, TFT_BLACK);
tft.drawString(myWiFiManager->getConfigPortalSSID(), 20, 48, 2);
tft.setTextColor(TFT_WHITE, TFT_BLACK);
tft.drawString("Password:", 5, 64, 2);
tft.setTextColor(TFT_BLUE, TFT_BLACK);
tft.drawString("12345678", 20, 82, 2);
tft.setTextColor(TFT_WHITE, TFT_BLACK);
tft.drawString("If it doesn't AutoConnect, use this IP:", 5, 110, 2);
tft.setTextColor(TFT_BLUE, TFT_BLACK);
tft.drawString(WiFi.softAPIP().toString(), 20, 128, 2);
tft.setTextColor(TFT_WHITE, TFT_BLACK);
}