43 lines
791 B
C++
43 lines
791 B
C++
/**
|
|
* @file displayWrapper.h
|
|
* @author Alexander Klein (alex@kleiax.de)
|
|
* @brief
|
|
* @version 0.1
|
|
* @date 2023-01-08
|
|
*
|
|
* @copyright Copyright (c) 2023
|
|
*
|
|
*/
|
|
|
|
#ifndef DISPLAY_WRAPPER_H
|
|
#define DISPLAY_WRAPPER_H
|
|
|
|
#include <iostream>
|
|
#include <LiquidCrystal_I2C.h>
|
|
|
|
#define DISPLAY_WRAPPER_ROWS 16
|
|
#define DISPLAY_WRAPPER_LINES 2
|
|
|
|
class DisplayWrapper {
|
|
public:
|
|
DisplayWrapper(LiquidCrystal_I2C* lcd);
|
|
|
|
void loop();
|
|
|
|
void clear();
|
|
void setCursor(uint8_t row, uint8_t line);
|
|
void print(const char *str);
|
|
|
|
|
|
private:
|
|
LiquidCrystal_I2C* lcd;
|
|
char data[DISPLAY_WRAPPER_LINES][DISPLAY_WRAPPER_ROWS];
|
|
|
|
uint8_t cursorRow = 0;
|
|
uint8_t cursorLine = 0;
|
|
|
|
bool changed = false;
|
|
};
|
|
|
|
#endif // DISPLAY_WRAPPER_H
|