Giter Club home page Giter Club logo

Comments (9)

janick avatar janick commented on August 10, 2024 1

Please pull and follow much simpler instructions: https://github.com/janick/WT32-SqLn#lanscape-orientation

from wt32-sqln.

janick avatar janick commented on August 10, 2024

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.

visued avatar visued commented on August 10, 2024

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.

janick avatar janick commented on August 10, 2024

Look closer.

I think you only need to make this change:

85c85
<       cfg.offset_rotation  =     1;
---
>       cfg.offset_rotation  =     0;

from wt32-sqln.

visued avatar visued commented on August 10, 2024

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.

janick avatar janick commented on August 10, 2024

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.

visued avatar visued commented on August 10, 2024

On change for screen rotate, Ui cutting 😔
I tried on two different squareline projects

from wt32-sqln.

janick avatar janick commented on August 10, 2024

Lemme dig out my one landscape project this week-end and re-confirm...

from wt32-sqln.

visued avatar visued commented on August 10, 2024

Hey man, works fine!!!

Thanks very much!

from wt32-sqln.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.