diff --git a/embedded/lib/Component/Screen.cpp b/embedded/lib/Component/Screen.cpp index 1cfeeb8..24d06d6 100644 --- a/embedded/lib/Component/Screen.cpp +++ b/embedded/lib/Component/Screen.cpp @@ -28,6 +28,7 @@ void Screen::Setup(uint8_t *font) connectedWindow.Add({TextBox("Connected to Wi-Fi !", StyleWidth::LEFT, U8G2_BTN_BW0), TextBox("IP address: ", StyleWidth::LEFT, U8G2_BTN_BW0), TextBox("addr", StyleWidth::CENTERED, U8G2_BTN_BW0)}); + loopWindow.Add(TextBox("Hello, Plant!", StyleWidth::CENTERED, U8G2_BTN_BW1)); } uint16_t Screen::setupHeader(const uint16_t w_padding, const uint16_t h_padding) @@ -95,11 +96,12 @@ void Screen::connected(const char *ipaddress, uint8_t timing) void Screen::loop() { - _screen->clearBuffer(); // clear the internal memory + _screen->clearBuffer(); _screen->setFont(_font); - _screen->drawStr(0, 10, "Hello Plant!"); // write something to the internal memory - _screen->sendBuffer(); // transfer internal memory to the display - delay(1000); + + loopWindow.Display(StyleHeight::CENTERED); + + _screen->sendBuffer(); } uint16_t Screen::getHeight() { return _height; } diff --git a/embedded/lib/Component/Screen.hpp b/embedded/lib/Component/Screen.hpp index 06cb975..f060c20 100644 --- a/embedded/lib/Component/Screen.hpp +++ b/embedded/lib/Component/Screen.hpp @@ -7,7 +7,7 @@ namespace Display { - constexpr uint8_t FONT_SIZE=6; + constexpr uint8_t FONT_SIZE=8; class Screen { @@ -48,6 +48,7 @@ namespace Display // Static Components Components connectingWindow; Components connectedWindow; + Components loopWindow; }; } diff --git a/embedded/src/main.cpp b/embedded/src/main.cpp index 8659b95..31d961b 100644 --- a/embedded/src/main.cpp +++ b/embedded/src/main.cpp @@ -18,7 +18,7 @@ Component humidity(ComponentType::Analog, PIN_A0); void setup() { Serial.begin(9600); - Display::Screen::GetInstance().Setup(const_cast(u8g2_font_profont10_tr)); + Display::Screen::GetInstance().Setup(const_cast(u8g2_font_busdisplay8x5_tr)); ServerHandler::GetInstance().setup(ssid, pswd); }