Git Product home page Git Product logo

Comments (18)

ihayri avatar ihayri commented on July 1, 2024 1

No problem, anyway I can help is good.

Correct, never mind the color definition, did remove that and put it at the beginning of the code.
It works rather nicely with digits updating without any flicker by just using fore and background colors.

So far I am loving this display and tomorrow I can finally try it outside in sunlight, where it is supposed to be seen without a problem. Viewing angles are great of course, being a IPS display.

Thank you again for your great library and all your help.

from lovyangfx.

lovyan03 avatar lovyan03 commented on July 1, 2024

@ihayri
Thank you for your interest !
I don't own an ILI9481 yet, so I can't check how it works.
I would also like to get ILI9481. Please let me know the product page URL and other information of the panel you purchased.

I've tentatively added the definition to the develop branch, so please try it out.

I think the basic functions will probably work, but there are many things like adjusting the rotation direction and reading pixel data that I need to see in action.

from lovyangfx.

ihayri avatar ihayri commented on July 1, 2024

Hi, thank you so much for replying. This is the link where I did buy my displays, it is the ILI9481 with single point touch display that uses the FT6236 chip that your great library supports as well.

https://www.aliexpress.com/item/1005001309491536.html

Here is a video I made today, where I do show the display and after much searching I finally found a library that does work with the ILI9481 and over SPI, as most other libraries do use parallel connection, which I would like not do do as it uses too many pins.

Your library works great with the ILI9488 which you can see in the video as well.

https://youtu.be/bl1exToW0Wo

https://github.com/moononournation/Arduino_GFX

I hope it is ok if I put links here, if not please remove them or I can do it I presume.

If there is anything I can do to help please let me know, thanks.

from lovyangfx.

lovyan03 avatar lovyan03 commented on July 1, 2024

@ihayri
Thanks for letting me know where to buy it !
I placed an order immediately.
It will probably take about two weeks to arrive.

In the meantime, I've added support for ILI9481 to the "develop" branch, so you can try it out.

from lovyangfx.

ihayri avatar ihayri commented on July 1, 2024

You are most welcome. I will try the the library and let you know later on.
Will go to bed soon as it is 5 o' clock in the morning here.
Take care and thank you.

from lovyangfx.

ihayri avatar ihayri commented on July 1, 2024

Hi lovyan, I am at it since this morning but so far I could not get it to work, I am probably doing something wrong. This is the code I am using:

#include <LovyanGFX.hpp>
#include "Panel_ILI9481.hpp"

struct LGFX_Config
{
  static constexpr spi_host_device_t spi_host = HSPI_HOST;
  static constexpr int dma_channel = 0;
  static constexpr int spi_sclk = 14;
  static constexpr int spi_mosi = 13;
  static constexpr int spi_miso = 12;
  static constexpr int spi_cs = 18;
  static constexpr int spi_dc = 22;
  static constexpr int spi_rst = 21;
  static constexpr int spi_dlen = 8;
};

static lgfx::LGFX_SPI<LGFX_Config> lcd;
static lgfx::Panel_ILI9481 panel;
static lgfx::Touch_FT5x06 touch;

void setup(void)
{

  Serial.begin(115200);
  panel.freq_write = 27000000;
  panel.freq_fill  = 27000000;
  panel.freq_read  = 16000000;
  panel.spi_mode = 0;
  panel.spi_mode_read = 0;
  panel.len_dummy_read_pixel = 8;
  panel.spi_read = true;
  panel.spi_3wire = false;
  panel.spi_cs = 15;
  panel.spi_dc = 33;
  panel.gpio_rst = 26;
  panel.gpio_bl  = 5;
  panel.pwm_ch_bl = 5;
  panel.backlight_level = true;
  panel.reverse_invert = false;
  panel.rgb_order = true;
  panel.memory_width  = 320;
  panel.memory_height = 480;
  panel.panel_width  = 320;
  panel.panel_height = 480;
  panel.offset_x = 0;
  panel.offset_y = 0;
  panel.rotation = 1;
  panel.offset_rotation = 0;
  lcd.setPanel(&panel);


  touch.i2c_port = I2C_NUM_1;
  touch.i2c_sda  = 26;
  touch.i2c_scl  = 27;
  touch.i2c_addr = 0x38;
  touch.freq = 400000;
  touch.x_min = 0;
  touch.x_max = 319;
  touch.y_min = 0;
  touch.y_max = 319;

  lcd.setTouch(&touch);

  lcd.init();
  Serial.println("lcd.init done");

  if (lcd.width() > 240 || lcd.height() > 240) lcd.setTextSize(2);

  if (lcd.touch())
  {
    if (lcd.width() < lcd.height()) lcd.setRotation(3 & (lcd.getRotation() + 1));
    lcd.drawString("touch the arrow marker.", 0, lcd.height() >> 1);
    lcd.clear();
  }
}

uint32_t count = ~0;
void loop(void)
{
  //  Serial.println("void loop started");
  delay(10);
  lcd.startWrite();
  lcd.setRotation(++count & 7);
  lcd.setColorDepth((count & 8) ? 16 : 24);

  lcd.setTextColor(random(65536));
  lcd.drawNumber(lcd.getRotation(), 16, 0);

  lcd.setTextColor(0xFF0000U);
  lcd.drawString("R", 30, 16);
  lcd.setTextColor(0x00FF00U);
  lcd.drawString("G", 40, 16);
  lcd.setTextColor(0x0000FFU);
  lcd.drawString("B", 50, 16);

  lcd.drawRect(30, 30, lcd.width() - 60, lcd.height() - 60, random(65536));

  lcd.endWrite();

  int32_t x, y;
  if (lcd.getTouch(&x, &y)) {
    lcd.fillRect(x - 2, y - 2, 5, 5, random(65536));

    Serial.print("x = ");
    Serial.print(x);
    Serial.print("  y = ");
    Serial.println(y);


  }
}

from lovyangfx.

ihayri avatar ihayri commented on July 1, 2024

Hope this is the correct way to add code :-)

from lovyangfx.

ihayri avatar ihayri commented on July 1, 2024

I did add a new tab with Panel_ILI9481.hpp , with #include "Panel_ILI9481.hpp"
Which might not be needed or completely wrong, sorry.

from lovyangfx.

lovyan03 avatar lovyan03 commented on July 1, 2024

@ihayri
Yes, you don't need that include statement.

Are you currently experiencing any errors?
Or is there something wrong with the operation?
I'm counting on your reports. Please let me know what's happening.

from lovyangfx.

ihayri avatar ihayri commented on July 1, 2024

Hi there, I am working on it with Tobozo since this morning and we have some steps toward it working.
this is the stripped down version:

LGFX Config

struct LGFX_Config
{
  static constexpr spi_host_device_t spi_host = HSPI_HOST;
  static constexpr int dma_channel = 0;
  static constexpr int spi_sclk = 14;
  static constexpr int spi_mosi = 13;
  static constexpr int spi_miso = 12;
  static constexpr int spi_dlen = 8;
};

Panel settings

panel.freq_write = 12000000;
panel.freq_fill  = 12000000;
panel.freq_read  = 12000000;
panel.spi_mode = 0;
panel.spi_mode_read = 0;
panel.len_dummy_read_pixel = 8;
panel.spi_read = true;
panel.spi_3wire = false;
panel.spi_cs = 15;
panel.spi_dc = 33;
panel.gpio_rst = 26;
panel.gpio_bl  = 5;
panel.pwm_ch_bl = 5;
panel.backlight_level = true;
panel.reverse_invert = true;
panel.rgb_order = false;
panel.memory_width  = 320;
panel.memory_height = 480;
panel.panel_width  = 320;
panel.panel_height = 480;
panel.offset_x = 0;
panel.offset_y = 0;
panel.rotation = 1;
panel.offset_rotation = 0; // tried with 1, no change on the display

Init sequence

static constexpr std::uint8_t list0[] = {
  CMD::SLPOUT ,  CMD_INIT_DELAY, 5,    // Exit sleep mode
  CMD::PWSET  , 3, 0x07, 0x41, 0x1D,
  CMD::VMCTR  , 3, 0x00, 0x1C, 0x1F,
  CMD::PWSETN , 2, 0x01, 0x11,
  CMD::PNLDRV , 5, 0x10, 0x3B, 0x00, 0x02, 0x11,
  CMD::FRMCTR , 1, 0x03,
  CMD::IFCTR  , 1, 0x83,
  CMD::GMCTR  ,12, 0x00, 0x26, 0x21, 0x00, 0x00, 0x1F,
                    0x65, 0x23, 0x77, 0x00, 0x0F, 0x00,
  0xB0        , 1, 0x00,  // CommandAccessProtect
  0xE4        , 1, 0xA0,
  0xF0        , 1, 0x01,
  0xFF,0xFF, // end
};

from lovyangfx.

ihayri avatar ihayri commented on July 1, 2024

and a picture
DSC_1427

from lovyangfx.

ihayri avatar ihayri commented on July 1, 2024

Hello Lovyan,

I did some progress and it does work now, the only thing I can not add are custom colors. Here is the current code:

#include <LovyanGFX.hpp>

struct LGFX_Config
{
  static constexpr spi_host_device_t spi_host = HSPI_HOST;
  static constexpr int dma_channel = 0;
  static constexpr int spi_sclk = 14;
  static constexpr int spi_mosi = 13;
  static constexpr int spi_miso = 12;
  static constexpr int spi_dlen = 8;
  static constexpr int TFT_DARKGRAY    = 0x7BEF;  // does not work
};

static lgfx::LGFX_SPI<LGFX_Config> lcd;
static lgfx::Panel_ILI9481 panel;
//static lgfx::Touch_FT5x06 touch;

void setup() {

  Serial.begin(115200);
  panel.freq_write = 17000000;
  panel.freq_fill  = 17000000;
  panel.freq_read  = 27000000;
  panel.spi_mode = 0;
  panel.spi_mode_read = 0;
  panel.len_dummy_read_pixel = 8;
  panel.spi_read = true;
  panel.spi_3wire = false;
  panel.spi_cs = 15;
  panel.spi_dc = 33;
  panel.gpio_rst = 26;
  panel.gpio_bl  = 5;
  panel.pwm_ch_bl = 5;
  panel.backlight_level = true;
  panel.reverse_invert = true;
  panel.rgb_order = false;
  panel.memory_width  = 320;
  panel.memory_height = 480;
  panel.panel_width  = 320;
  panel.panel_height = 480;
  panel.offset_x = 0;
  panel.offset_y = 0;
  panel.rotation = 1;
  panel.offset_rotation = 0;

  lcd.setPanel(&panel);

  lcd.init();
  lcd.setBrightness(255);
  lcd.setColorDepth(24);
//  lcd.fillScreen (TFT_DARKGRAY);  // produces vertical lines and wrong color
  lcd.fillScreen (TFT_BLACK);
  
  lcd.setTextSize(4);
  lcd.setTextColor(TFT_RED, TFT_BLACK);
  lcd.drawString("R", 30, 30);
  lcd.setTextColor(TFT_GREEN);
  lcd.drawString("G", 60, 30);
  lcd.setTextColor(TFT_BLUE);
  lcd.drawString("B", 90, 30);
  lcd.setTextColor(TFT_YELLOW, TFT_BLUE);
  lcd.setTextSize(3);
  lcd.drawString("ILI9481 Working", 30, 90);

  lcd.drawRect(30, 30, lcd.width() - 60, lcd.height() - 60, TFT_BLUE);

  delay(3000);
}

void loop() {

  lcd.setTextSize(4);
  lcd.setTextColor(TFT_WHITE, TFT_RED);
  lcd.drawString("R", 30, 30);
  delay(1000);
  lcd.setTextColor(TFT_BLACK, TFT_GREEN);
  lcd.drawString("G", 60, 30);
  delay(1000);
  lcd.setTextColor(TFT_YELLOW, TFT_BLUE);
  lcd.drawString("B", 90, 30);

}

from lovyangfx.

ihayri avatar ihayri commented on July 1, 2024

and a picture

DSC_1425

from lovyangfx.

ihayri avatar ihayri commented on July 1, 2024

PS: it does not like random colors, that was the problem in the first picture.

I am sure you can fix that. Somehow the panel frequencies are pretty low.

ILI9481_v0.35.pdf

maybe the pdf file will help you further if you don't have it already.

Thank you very much for all your work and thanks to Tobozo as well of course.

Just noticed that he edited my first code upload to me more readable, thanks Tobozo :-)

from lovyangfx.

lovyan03 avatar lovyan03 commented on July 1, 2024

@ihayri
Thank you for the information.

Do not make TFT_DARKGRAY a member of LGFX_Config.
It should be placed outside of LGFX_Config.

I ordered ILI9481 and it seems it has already shipped.
I will make adjustments when I receive the product.

from lovyangfx.

fsender avatar fsender commented on July 1, 2024

Now I'm using ILI9481 on an ESP32 with 12MHz SPI. It's too slow for me. And its pixels cannot be read in your examples. What can I do? My sketch needs to read pixels on it.

from lovyangfx.

lovyan03 avatar lovyan03 commented on July 1, 2024

@fsender
Try changing the settings here.

  panel.spi_3wire = false; // or true

from lovyangfx.

tobozo avatar tobozo commented on July 1, 2024

closing this issue as solved, feel free to reopen if needed

from lovyangfx.

Related Issues (20)

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.