49 size_t len = strlen(buf);
51 memset(clrBuf,
' ', len);
59 double temp =
trs[i].readTemp();
61 printf(col, row,
"%2u", 0);
63 printf(col, row,
"%2u",
static_cast<uint8_t
>(temp));
69 if(value + delta < min) {
73 if(value + delta > max) {
const uint16_t refreshInterval
static void adjustValue(double delta, double &value, uint8_t min, uint8_t max)
In-/de-crement a variable, while clipping it to [min, max].
etl::span< const ThermistorReader, 4 > trs
unsigned long lastRefreshed
Last time display was updated (in millis)
const uint16_t splashDuration
void update()
Update the display and handle input: set Humidistat's setpoint.
const uint16_t inputInterval
virtual void drawSplash()=0
Draw splash screen.
virtual void setCursor(uint8_t col, uint8_t row)=0
Set cursor to coordinates.
const uint16_t infoDuration
void printf(uint8_t col, uint8_t row, const char *fmt, T... args)
Print formatted data to display, at (col, row). Calculates lengths and creates appropriate buffer int...
const uint16_t blinkInterval
virtual bool handleInput(Buttons state, uint16_t pressedFor)=0
Handle input.
const uint16_t buttonDebounceInterval
ControllerUI(Print *display, const ButtonReader *buttonReader, etl::span< const ThermistorReader, 4 > trs)
Constructor.
const ButtonReader & buttonReader
void printNTC(uint8_t col, uint8_t row, uint8_t i)
Print temperature read from thermistors. Handles NaN values as 0.
virtual void drawInfo()=0
Draw info screen.
virtual void draw()=0
Draw main interface (main loop).
unsigned long lastPressed
Last time a keypress event occurred (in millis)
virtual void clear()=0
Clear screen.
void blink(uint8_t col, uint8_t row, const char *buf)
Print blinking text.
ButtonReader buttonReader(config::PIN_BTN, &voltLadder)