Close

Step 1: Squareline

A project log for Wireless Relay Controller With Integrated HA

In this article, I'm going to make a Relay Controller, which integrated LVGL and Home Assistant, based on ESP32-S3 Parallel TFT with Touch 7

makerfabsMakerfabs 12/13/2023 at 00:420 Comments

Choose the Arduino and enter in parameters. According to the features of MaTouch ESP32-S3 Parallel TFT with Touch 7" ,the resolution is 1024*600, the shape is rectangle, and the color depth is 16-bit.

Add the images and fonts you like to assets, and then it allows you to select them and widget components to design the scenes. After, clicking the widget of the list on the Hierarchy panel, you can modify the parameters of the select widget on the Inspector panel, all is determined by your preference.

We need to set up events for each button to go to the interrupt function when the button is pressed;

once the file is exported, we need to copy the UI library folder to Document >> Arduino >> libraries;

and modify the events.c file in the UI folder so that it enables the http_func call.

extern int index1;
extern int http_flag;

void button1_func(lv_event_t * e)
{
    http_flag = 1;
    index1 = 0;
}

void button2_func(lv_event_t * e)
{
    http_flag = 1;
    index1 = 1;
}

void button3_func(lv_event_t * e)
{
    http_flag = 1;
    index1 = 2;
}

void button4_func(lv_event_t * e)
{
    http_flag = 1;
    index1 = 3;
}

Discussions