33 for (
size_t i = 0; i <
trs.size(); ++i) {
56 printf(0, 0,
"%4u %3.2f %4.3f",
61 printf(0, 1,
"%4.3f %4.3f",
char * asprintf(const char *fmt, T... args)
Print formatted data to string. Automatically allocates string on the heap. Make sure to delete it im...
LiquidCrystal & liquidCrystal
void drawSplash() override
Draw splash screen.
bool handleInput(Buttons state, uint16_t pressedFor) override
Handle input.
void setCursor(uint8_t col, uint8_t row) override
Set cursor to coordinates.
CharDisplayUI(LiquidCrystal *liquidCrystal, const ButtonReader *buttonReader, SingleHumidistat *humidistat, etl::span< const ThermistorReader, 4 > trs)
Constructor.
void drawInfo() override
Draw info screen.
void draw() override
Draw main interface (main loop).
SingleHumidistat & humidistat
void begin() override
Initialize the display.
void clear() override
Clear screen.
User interface (display and input) for humidistat. Hold references to ButtonReader for keypad input,...
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)
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...
void printNTC(uint8_t col, uint8_t row, uint8_t i)
Print temperature read from thermistors. Handles NaN values as 0.
void blink(uint8_t col, uint8_t row, const char *buf)
Print blinking text.
const ConfigStore * getConfigStore()
Get a pointer to the ConfigStore instance.
double cv
Control variable.
double getHumidity() const
Read the humidity.
double getTemperature() const
Read the temperature.
Control humidity using PID by driving two solenoid valves. Adjust the public setpoint variable and ca...
SerialLogger< cHumidistat > serialLogger & humidistat
ButtonReader buttonReader(config::PIN_BTN, &voltLadder)
double HC_Kp
Humidity controller PID parameters.
double S_lowValue
Minimum solenoid duty cycle (deadband)
uint16_t dt
Global interval for PID/logger (based on polling rate of sensor, in millis)