Closed visued closed 1 year ago
Hmmmmm my instructions might be wrong. Here's the difference in my landscape UI:
39,41c39,41
< // Landscape
< #define TFT_WIDTH 480
< #define TFT_HEIGHT 320
---
> // Portrait
> #define TFT_WIDTH 320
> #define TFT_HEIGHT 480
81,82c81,82
< cfg.panel_width = 320;
< cfg.panel_height = 480;
---
> cfg.panel_width = TFT_WIDTH;
> cfg.panel_height = TFT_HEIGHT;
85c85
< cfg.offset_rotation = 1;
---
> cfg.offset_rotation = 0;
Yeah, this config is same here, don't work for me :( In Portrait don't cut ;/
// SD card Working / enable it below
#define WT32_SC01_PLUS
#define SD_SUPPORTED
#define LGFX_USE_V1
#include <LovyanGFX.hpp>
// SD CARD - SPI
#define SDSPI_HOST_ID SPI3_HOST
#define SD_MISO GPIO_NUM_38
#define SD_MOSI GPIO_NUM_40
#define SD_SCLK GPIO_NUM_39
#define SD_CS GPIO_NUM_41
// Landscape
#define TFT_WIDTH 480 //---------> my change
#define TFT_HEIGHT 320 //---------> my change
// Portrait
// #define TFT_WIDTH 320
// #define TFT_HEIGHT 480
class LGFX : public lgfx::LGFX_Device
{
lgfx::Panel_ST7796 _panel_instance; // ST7796UI
lgfx::Bus_Parallel8 _bus_instance; // MCU8080 8B
lgfx::Light_PWM _light_instance;
lgfx::Touch_FT5x06 _touch_instance;
public:
LGFX(void)
{
{
auto cfg = _bus_instance.config();
cfg.freq_write = 40000000;
cfg.pin_wr = 47;
cfg.pin_rd = -1;
cfg.pin_rs = 0;
// LCD data interface, 8bit MCU (8080)
cfg.pin_d0 = 9;
cfg.pin_d1 = 46;
cfg.pin_d2 = 3;
cfg.pin_d3 = 8;
cfg.pin_d4 = 18;
cfg.pin_d5 = 17;
cfg.pin_d6 = 16;
cfg.pin_d7 = 15;
_bus_instance.config(cfg);
_panel_instance.setBus(&_bus_instance);
}
{
auto cfg = _panel_instance.config();
cfg.pin_cs = -1;
cfg.pin_rst = 4;
cfg.pin_busy = -1;
cfg.panel_width = TFT_WIDTH;
cfg.panel_height = TFT_HEIGHT;
cfg.offset_x = 0;
cfg.offset_y = 0;
cfg.offset_rotation = 1; // -------> my change
cfg.dummy_read_pixel = 8;
cfg.dummy_read_bits = 1;
cfg.readable = false;
cfg.invert = true;
cfg.rgb_order = false;
cfg.dlen_16bit = false;
cfg.bus_shared = false;
_panel_instance.config(cfg);
}
{
auto cfg = _light_instance.config();
cfg.pin_bl = 45;
cfg.invert = false;
cfg.freq = 44100;
cfg.pwm_channel = 7;
_light_instance.config(cfg);
_panel_instance.setLight(&_light_instance);
}
{
auto cfg = _touch_instance.config();
cfg.x_min = 0;
cfg.x_max = 319;
cfg.y_min = 0;
cfg.y_max = 479;
cfg.pin_int = 7;
cfg.bus_shared = true;
cfg.offset_rotation = 0;
cfg.i2c_port = 1;//I2C_NUM_1;
cfg.i2c_addr = 0x38;
cfg.pin_sda = 6;
cfg.pin_scl = 5;
cfg.freq = 400000;
_touch_instance.config(cfg);
_panel_instance.setTouch(&_touch_instance);
}
setPanel(&_panel_instance);
}
};
Look closer.
I think you only need to make this change:
85c85
< cfg.offset_rotation = 1;
---
> cfg.offset_rotation = 0;
In file exists two lines with this:
cfg.offset_rotation
Change all to cfg.offset_rotation = 1 ?
On sample code above, I set cfg.offset_rotation = 1
in panel instance...
Hmmm.... didn't notice that.
Looks like one is for the display, the other for the touch screen. Give it a try: rotate one and see if the touch sensors align. If not, rotate both!
On change for screen rotate, Ui cutting 😔 I tried on two different squareline projects
Lemme dig out my one landscape project this week-end and re-confirm...
Please pull and follow much simpler instructions: https://github.com/janick/WT32-SqLn#lanscape-orientation
Hey man, works fine!!!
Thanks very much!
Hi my friends, I make another project based on this project. Im make GUI on Squareline and export UI files to WT32-SqLn/main/ui I following this guide https://github.com/janick/WT32-SqLn#lanscape-orientation for configure landscape orientation But, after flash my UI is cutting:
I do not have idea how to solve this.
Best regards