added compass amd displayWrapper

This commit is contained in:
2023-01-09 09:40:06 +01:00
parent 9762aabb00
commit 26095369dd
9 changed files with 170 additions and 39 deletions
+42
View File
@@ -0,0 +1,42 @@
/**
* @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