Changed font

This commit is contained in:
Yohan Boujon 2023-11-27 23:30:29 +01:00
parent cf50debfd0
commit 668d22fd40
3 changed files with 9 additions and 6 deletions

View file

@ -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; }

View file

@ -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;
};
}

View file

@ -18,7 +18,7 @@ Component humidity(ComponentType::Analog, PIN_A0);
void setup()
{
Serial.begin(9600);
Display::Screen::GetInstance().Setup(const_cast<uint8_t*>(u8g2_font_profont10_tr));
Display::Screen::GetInstance().Setup(const_cast<uint8_t*>(u8g2_font_busdisplay8x5_tr));
ServerHandler::GetInstance().setup(ssid, pswd);
}