First commit - WIP
This commit is contained in:
52
src/grafik.h
Normal file
52
src/grafik.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#ifndef GRAFIK_H
|
||||
#define GRAFIK_H
|
||||
|
||||
/* Install the "lvgl" library version 9.X by kisvegabor to interface with the TFT Display - https://lvgl.io/
|
||||
*** IMPORTANT: lv_conf.h available on the internet will probably NOT work with the examples available at Random Nerd Tutorials ***
|
||||
*** YOU MUST USE THE lv_conf.h FILE PROVIDED IN THE LINK BELOW IN ORDER TO USE THE EXAMPLES FROM RANDOM NERD TUTORIALS ***
|
||||
FULL INSTRUCTIONS AVAILABLE ON HOW CONFIGURE THE LIBRARY: https://RandomNerdTutorials.com/cyd-lvgl/ or https://RandomNerdTutorials.com/esp32-tft-lvgl/ */
|
||||
#include <lvgl.h>
|
||||
|
||||
/* Install the "TFT_eSPI" library by Bodmer to interface with the TFT Display - https://github.com/Bodmer/TFT_eSPI
|
||||
*** IMPORTANT: User_Setup.h available on the internet will probably NOT work with the examples available at Random Nerd Tutorials ***
|
||||
*** YOU MUST USE THE User_Setup.h FILE PROVIDED IN THE LINK BELOW IN ORDER TO USE THE EXAMPLES FROM RANDOM NERD TUTORIALS ***
|
||||
FULL INSTRUCTIONS AVAILABLE ON HOW CONFIGURE THE LIBRARY: https://RandomNerdTutorials.com/cyd-lvgl/ or https://RandomNerdTutorials.com/esp32-tft-lvgl/ */
|
||||
#include <TFT_eSPI.h>
|
||||
|
||||
typedef struct {
|
||||
lv_obj_t * arc;
|
||||
const char * name;
|
||||
int x;
|
||||
int y;
|
||||
int size;
|
||||
float value;
|
||||
const char* valformat;
|
||||
const char* const unit;
|
||||
int lowvalue;
|
||||
int highvalue;
|
||||
int green;
|
||||
int yellow;
|
||||
|
||||
} ARC;
|
||||
|
||||
|
||||
|
||||
#define SCREEN_WIDTH 320
|
||||
#define SCREEN_HEIGHT 240
|
||||
|
||||
|
||||
#ifdef MAIN
|
||||
ARC arcTemp = {NULL, "temp", 30, 0, 110, 30.0, "%.1f", "°C", 10, 30, 20, 25};
|
||||
ARC arcHum = {NULL, "humi", 180, 0, 110, 60.0, "%.0f", "%",0, 100, 50, 70};
|
||||
#else
|
||||
extern ARC arcTemp;
|
||||
extern ARC arcHum;
|
||||
#endif
|
||||
|
||||
|
||||
void setup_grafik(void);
|
||||
void lv_create_main_gui(void);
|
||||
void setValuetoArc(ARC arc, float value);
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user