I can't fill the entire display. Only 75% is usable. ESP32S3 and Waveshare 2inch LCD #2787
Replies: 4 comments 1 reply
-
Change to: The display width and height must be specified in portraint mode. |
Beta Was this translation helpful? Give feedback.
-
Thanks, but I've tried that. I've included a pic of the LCD with the width and height in the order you asked for. You can see the print output of them in the pic. For this pic, there is no set_rotation specified. It appears that the print statement is printing in land scape. Since startup is in portrait, I would have thought that the text should have printed in portrait a;so. This lcd output is generated from the sketch listed above except for the swapping of the width and height. |
Beta Was this translation helpful? Give feedback.
-
Hi, did you solve the problem? |
Beta Was this translation helpful? Give feedback.
-
Yes I did. I thought I posted here what the solution was but I guess it was on the Seeed forum only, sorry. The problem was that the sketch listed above uses pin numbers. It should reference the GPIO numbers instead. Using pin numbers worked on the C version where the pin numbers matched up with the GPIO numbers but the the S version is different so..................... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is sort of a continuation of a previous post where I was having problems getting the Waveshare 2inch LCD Module to work with my Xiao esp32s3 board. That is kinda solved. The problem I'm having is that I can only light up 75% of the display. The display is 320x240 pixels. If I specify a Width and Height of 320x240, and fill the screen with a color, I get what appears to be a 240 pixel square of the color I specified. I've added text to the screen to verify where 0,0 is and the orientation and rotated the screen with all of the options for set rotation. I've also tried using 320w x 240h and well as 240w x 320h to see if that would make a difference. No matter what combination I use, I end up with a 240 pixel square. I feel like there is something I'm missing so any help would be appreciated.
Edit: It turns out that it really doesn't matter what values I use for TFT_WIDTH and TFT_Height, I get the same response on the screen. I appears to be a 240x240 pixel square area to work in. The rest of the display is random garbage.
Below is a copy of the sketch I'm using for this.
#include <SPI.h>
#include <TFT_eSPI.h> // Hardware-specific library
#define ST7789_2_DRIVER
#define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
#define TFT_INVERSION_ON
#define TFT_MISO -1
#define TFT_MOSI D10
#define TFT_SCLK D8
#define TFT_CS D1 // Chip select control pin. Did not work on D7
#define TFT_DC D3 // Data Command control pin
#define TFT_RST D4 // Reset pin
#define TFT_BL D6
//#define SPI_FREQUENCY 27000000 // It worked at 40000000 but I left this in incase something goes wrong
#define SPI_FREQUENCY 40000000
#define TFT_WIDTH 320
#define TFT_HEIGHT 240
TFT_eSPI tft = TFT_eSPI(); // Invoke custom library
void setup() {
tft.begin();
tft.setRotation(0);
tft.fillScreen(TFT_RED);
tft.setCursor(10,10);
tft.setTextColor(TFT_WHITE, TFT_BLACK);
tft.println("Hello "+String(TFT_WIDTH)+" "+String(TFT_HEIGHT));
}
void loop() {
// do nothing
}
Beta Was this translation helpful? Give feedback.
All reactions