Help with TFT LCD 3.6" OR 3.5"

First of all I apologize for my English, I translate from Google.
I was looking for a solution here on the site, but did not find.

I bought the board in this link, 3.6 inches.

Description:
Tftlcd 3.6-inch touch screen with uno r3
3.6-inch LCD touch screen
Resolution : 480x320
Controller : ili9488
Test code:
ILI9327:
LCD_Write_COM(0xE9);
……
I got the board in a picture, 3.5 inches.

I connect to the UNO board, and trying with ILI9327 driver,
Trying to run example from UTFT library, located at the following link.

http://www.rinkydinkelectronics.com/library.php?id=51

And still get a white screen.
Where is my mistake?
Help.

By the way,
I can not find the URL to put the picture.

Please read the reply in related thread

No, I don’t think there are any UTFT “models” that would ever match your display.

It would be interesting to hear what controller you have actually got.
And which (if any) of the photos on your Ebay link match the item you have got on your desk.

David.

David,

You are very right, and thanks for the link.
But I stuck with it, and can not find a solution,
I read the link, and I have not found something that can help.
Thanks.

By the way, how I can add a picture here? Through which site would you recommend?

You can insert an image into your message. Be reasonable with size and resolution.
Or paste the URL of the site where your image lives.
Or insert a clickable link.
Or attach a JPG of the image.

But quite honestly, you can simply describe differences to the photos on Ebay link in text. e.g.
photo 1: left is correct, right is wrong shape
photo 2: wrong shape, different printing on Touch Panel
photo 3: wrong shape, different printing on Touch Panel
photo 4: wrong shape, different printing on Touch Panel
photo 5: wrong shape, different printing on pcb. ...
photo 6: wrong shape, different printing on pcb. ...

Say what the different printing says on your display.

In practice, you could install my library. Run the examples.
Paste the output from LCD_ID_readreg.ino

David.

Thanks,
The display does not respond and remains white.
I tried with UNO and with MEGA.
Where do I download your library?

There is a Beta version of MCUFRIEND_kbv library on GitHub

I asked if you could compare the photos on your Ebay link with the shield on your desk.
You had already said that you had a white screen with UTFT.

David.

Thanks for the link,

The board I received is 3.5"

Thanks David,

You are a genius,
With the link you gaveת it works.

Million Thanks.

For the benefit of all the other purchasers from these mendacious Ebay websites:

What shape? 240x400 or 320x480?
What controller?

Your photo shows a pcb wih NO 3.3V regulator.
A Uno or even a Mega can not supply a 200mA backlight from its 3.3V regulator.
It can generally supply 200mA from its USB. But I do not see any evidence of a current-limiting resistor for the Backlight.

David.

I try the example “GLUE_Demo_480x320” with UNO and MEGA. and works fine.
When I try example “LCD_ID_readreg” I receive in serial monitor what you can see in pic. attached.
I do not know which driver it works.

You have a Renesas R61581 controller with ID=0x1581
Probably with a 320x480 display Panel.

So every photo on your Ebay link is untrue. (except for the left hand side of photo #1)

Most of the example sketches will report the ID on the Serial Terminal.

David

You right, with the example “testcard_kbv” I receive the attached pic.
What I must do to display with “LANDSCAPE_REV” in this example?

Read the example code.

From memory, it is written for a 240x320 display in LANDSCAPE (i.e. 320x240)
So I guess that it will say tft.setRotation(1); somewhere in setup().

If you want to display on your 320x480 screen, it will obviously fit in any direction.
If you want LANDSCAPE_REV, you just say: tft.setRotation(3);

Most sketches will have a single tft.setRotation(); statement.
Or possibly none at all. tft.begin() always puts the display in PORTRAIT mode as default.

David.

I added the following lines, and it will work good.
Only the resolution could not change to 320x480 screen.

  //  To change aspect
uint8_t aspect;
char *aspectname[] = {
    "PORTRAIT", "LANDSCAPE", "PORTRAIT_REV", "LANDSCAPE_REV" 
};

void loop(void)
{
    aspect = 3;                   //  To change aspect
    tft.setRotation(aspect);      //  To change aspect

Please post a complete sketch.

tft.readID() will return 0x1581 for your R61581 controller.
Yes, of course tft.width() will return 320 in Portrait and 480 in Landscape.

David.

OK, I use this code :

where I need to change for 480X320?

/*
 * generate testcard similar to BMP
 */

#include <Adafruit_GFX.h>
#if defined(_GFXFONT_H_)           //are we using the new library?
#include <Fonts/FreeSans9pt7b.h>
#define ADJ_BASELINE 11            //new fonts setCursor to bottom of letter
#else
#define ADJ_BASELINE 0             //legacy setCursor to top of letter
#endif
#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft;

#define BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF

#define GREY    0x7BEF

#include <stdio.h>

uint16_t ID;
uint8_t hh, mm, ss; //containers for current time

uint8_t conv2d(const char* p)
{
    uint8_t v = 0;
    if ('0' <= *p && *p <= '9') v = *p - '0';
    return 10 * v + *++p - '0';
}

void setup(void)
{
     Serial.begin(9600);
    tft.reset();
    ID = tft.readID();
    Serial.print("TFT ID = 0x");
    Serial.println(ID, HEX);
    //    if (ID == 0x00D3) ID = 0x9481; // write-only shield
    if (ID == 0x00D3) ID = 0x9486; // write-only shield
    tft.begin(ID);
    tft.setRotation(1);
    tft.fillScreen(BLACK);
#if defined(_GFXFONT_H_)
    tft.setFont(&FreeSans9pt7b);
#endif
    hh = conv2d(__TIME__);
    mm = conv2d(__TIME__ + 3);
    ss = conv2d(__TIME__ + 6);

}
  //  To change aspect
uint8_t aspect;
char *aspectname[] = {
    "PORTRAIT", "LANDSCAPE", "PORTRAIT_REV", "LANDSCAPE_REV" 
};

void loop(void)
{
    aspect = 3;                   //  To change aspect
    tft.setRotation(aspect);      //  To change aspect
    
    int16_t x, y, dx, dy, idx;
    uint16_t w, h, len, mask;
    uint16_t colors[8] = { BLACK, WHITE, YELLOW, CYAN, GREEN, MAGENTA, RED, BLUE };
    uint16_t height, width;
    width = tft.width();
    height = tft.height();
    tft.fillRect(0, 0, 7, 3, WHITE);
    tft.fillRect(313, 0, 7, 3, WHITE);
    tft.fillRect(0, 237, 7, 3, WHITE);
    tft.fillRect(313, 237, 7, 3, WHITE);
    for (y = 0, w = 18, h = 3; y < 240; y += 13 * w + h) {
        for (x = 25; x < 320 - 18; x += 2 * w) {
            tft.fillRect(x, y, w, h, WHITE);
        }
    }
    for (x = 0, w = 7, h = 18; x < 320; x += 17 * h + w) {
        for (y = 21; y < 240 - 18; y += 2 * h) {
            tft.fillRect(x, y, w, h, WHITE);
        }
    }
    tft.fillRect(7, 3, 17 * 18, 13 * 18, GREY);
    for (x = 7, y = 0, w = 1, h = 240; x < 320; x += 18) {
        tft.fillRect(x, y, w, h, WHITE);
    }
    for (x = 0, y = 3, w = 320, h = 1; y < 240; y += 18) {
        tft.fillRect(x, y, w, h, WHITE);
    }
    tft.fillRect(26, 22, 17, 99, tft.color565(0, 128, 64));     //turq
    tft.fillRect(26, 120, 17, 99, tft.color565(255, 128, 192)); //pink
    tft.fillRect(44, 22, 17, 35, tft.color565(0, 128, 255));    //blue
    tft.fillRect(44, 184, 17, 35, tft.color565(255, 128, 64));  //orng
    tft.fillRect(260, 22, 17, 35, tft.color565(0, 128, 255));     //blue
    tft.fillRect(260, 184, 17, 35, tft.color565(255, 128, 64));  //orng
    tft.fillRect(278, 22, 17, 99, tft.color565(128, 128, 0));   //grn
    tft.fillRect(278, 120, 17, 99, tft.color565(128, 0, 255)); //purp

    for (dx = 111; dx > -111; dx--) {
        w = sqrt(111 * 111 - dx * dx);
        y = 120 - dx;
        dy = (y - 3) / 18;
        mask = 7;
        switch (dy) {
            case 0:
            case 1: idx = 1; len = 0; break;
            case 2: idx = 0; len = 0; break;
            case 3: idx = 0; len = 13; mask = 1; break;
            case 4:
            case 5: idx = 2; len = 38; break;
            case 6:
            case 7:
            case 8: idx = 0; len = 0; break;
            case 9: for (idx = 2; idx < 8; idx++) {
                    dy = 0xFF >> (7 - idx);
                    colors[idx] = tft.color565(dy, dy, dy);
                }
                idx = 2; len = 38; break;
            case 10: idx = 1; len = 0; break;
            case 11:
            case 12: colors[2] = YELLOW; idx = 2; len = 0; break;
        }
        if (len == 0)
            tft.fillRect(160 - w, y, w * 2, 1, colors[idx]);

        else {
            if (mask == 1) idx = 1 + (w) / len;
            dy = w % len;
            for (x = 160 - w; x < 160 + w; idx++) {
                tft.fillRect(x, y, dy, 1, colors[idx & mask]);
                x += dy;
                if (x + len > 160 + w) dy = w % len;
                else dy = len;
            }
        }

    }
    for (x = 72, y = 129, dx = 5, dy = 0; dx > 0; x += 2 * dx) {
        tft.fillRect(x, y, dx, 36, WHITE);
        dy += dx * 2;
        if (dy >= 36) {
            dy = 0;
            dx--;
        }
    }
    tft.fillRect(160 - 8, 5 * 18 + 3, 17, 3 * 18, BLACK);
    for (x = 3 * 18 + 7, y = 6 * 18 + 3, w = 1, h = 18; x < 160 + 108; x += 18) {
        tft.fillRect(x, y, w, h, WHITE);
    }
    tft.fillRect(160 - 108, 120, 108 * 2, 1, WHITE);
    tft.fillRect(160, 5 * 18 + 3, 1, 3 * 18, WHITE);
    tft.fillRect(108, 2 * 18 + 3, 6 * 18, 18, WHITE);
    //    tft.fillRect(108, 10 * 18 + 3, 6 * 18, 18, BLACK);
    tft.fillRect(160 - 8, 11 * 18 + 3, 17, 31, RED);
    tft.setCursor(160 - 36, 24 + ADJ_BASELINE);
    tft.setTextColor(BLACK);
    tft.setTextSize(1);
    tft.print("320x240");
    tft.setCursor(109, 43 + ADJ_BASELINE);
    tft.setTextColor(BLACK);
    tft.setTextSize(1);
    tft.print("ID=0x");
    tft.print(tft.readID(), HEX);
    tft.setTextColor(WHITE, BLACK);
    //    tft.setFont(NULL);
    //    tft.setTextSize(2);
    while (1) {
        if (++ss > 59) {
            ss = 0;
            mm++;
            if (mm > 59) {
                mm = 0;
                hh++;
                if (hh > 23) hh = 0;
            }
        }
        char buf[20];
        sprintf(buf, "%02d:%02d:%02d", hh, mm, ss);
        tft.fillRect(108, 10 * 18 + 3, 6 * 18, 18, BLACK);
        tft.setCursor(128, 187 + ADJ_BASELINE);
        tft.print(buf);
        delay(1000);
    }
}

Thanks.

I translate all 480 to 320, and all 240 to 320,
And see the Pic. attached

Look at the structure of your sketch:

void loop(void)
{
    aspect = 3;                   //  To change aspect
    tft.setRotation(aspect);      //  To change aspect
   
    ...
    // draw picture
    ...
    while (1) {
        if (++ss > 59) {
            ...
        }
        ...    
        sprintf(buf, "%02d:%02d:%02d", hh, mm, ss);
        tft.fillRect(108, 10 * 18 + 3, 6 * 18, 18, BLACK);
        tft.setCursor(128, 187 + ADJ_BASELINE);
        tft.print(buf);
        delay(1000);
    }
}

So the loop()l will never end. It always displays in the aspect that you chose at the start of loop()

You could change the logic:

void loop(void)
{
    if (++aspect > 3) aspect = 0;  // go through all 4 aspects.
    tft.setRotation(aspect);      //  To change aspect
    tft.fillScreen(BLACK);          // clear screen   
    ...
    // draw picture
    ...
    while (1) {
        ...
        sprintf(buf, "%02d:%02d:%02d", hh, mm, ss);
        tft.fillRect(108, 10 * 18 + 3, 6 * 18, 18, BLACK);
        tft.setCursor(128, 187 + ADJ_BASELINE);
        tft.print(buf);
        delay(1000);
        if ((mm % 10) == 0) {   //break the while lop every 10 minutes.
            break;
        }
    }
}

Untested. Just experiment for yourself.
I find that a pencil and paper is a good way to draw flowcharts.

This example was designed for a 240x320 screen. You could calculate all the dimensions related to your screen size. It gets a little messy.

David.

Thanks,
I'll check later.

Meanwhile, I think to write code that will display an aspect of choice on the screen with the touch,
And image display with on-screen selection, from a file on the SD card.
Have recommendations or examples that can help me?

Now I’m with a new problem.

From Library “MCUFRIEND_kbv-master”
I run the example “GLUE_Demo_480x320”

I’m trying to change the aspect, by adding the lines I did above, and does not work,
I’m trying to change the font size, and does not work, is there a command MidFont?
How can i do it?