Comments (9)
Please pull and follow much simpler instructions: https://github.com/janick/WT32-SqLn#lanscape-orientation
from wt32-sqln.
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;
from wt32-sqln.
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);
}
};
from wt32-sqln.
Look closer.
I think you only need to make this change:
85c85
< cfg.offset_rotation = 1;
---
> cfg.offset_rotation = 0;
from wt32-sqln.
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...
from wt32-sqln.
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!
from wt32-sqln.
On change for screen rotate, Ui cutting 😔
I tried on two different squareline projects
from wt32-sqln.
Lemme dig out my one landscape project this week-end and re-confirm...
from wt32-sqln.
Hey man, works fine!!!
Thanks very much!
from wt32-sqln.
Related Issues (17)
- connection diagram of the programmer HOT 2
- config psram in vscode platformio HOT 2
- OTA problem HOT 3
- Work with Pure LVGL only (instead of Lovyan) HOT 3
- USB C Programing with a poorly designed jack HOT 1
- VSC no cmake list
- Demo Squareline Project HOT 2
- Which type/norm of socket is the debug connector of WT32-SC01 Plus HOT 2
- Looks great - case HOT 6
- Thank you - IO ideas HOT 2
- Failed build HOT 4
- Wake-up Pin HOT 4
- ZIP-file for SquareLine HOT 11
- Failed build: LCD_CAM_LCD_UPDATE_REG HOT 4
- No upload happening.. HOT 1
- Error on build project HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wt32-sqln.