What happend to tft.readRect() and tft.pushRect()??? Are there bugs? #2440
Replies: 7 comments 3 replies
-
I pu together a complete example to test and it works fine on my setup, SPI interface ST7796 and RP2040 Pico. Try it: |
Beta Was this translation helpful? Give feedback.
-
The problem persists. Please see the picture. |
Beta Was this translation helpful? Give feedback.
-
I added two lines: read the block from (64,64) and put it to another location on TFT and I see the correct color! void loop() {
} |
Beta Was this translation helpful? Give feedback.
-
Ah! You have a parallel bus interface display. The SPI speeds are irrelevant and mislead me into testing a SPI display. I think this is fixed now in the latest master library. You will need to download direct from Github. |
Beta Was this translation helpful? Give feedback.
-
I downlaoded the latest version 2.5.22 [env:esp32-s3-devkitc-1] |
Beta Was this translation helpful? Give feedback.
-
Dear Bodmer, I still see the problem (see thea above post). Can you support? |
Beta Was this translation helpful? Give feedback.
-
These are my etst results:
TFT_CS = GPIO 10 TFT_D0 = GPIO 1 TFT_BL = GPIO 4 Font GLCD loaded [/code] |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using a 480x320 TFT driven by ST7796.
I pushed a JPEG picture to the TFT using JPEGDecoder.h lib. Then I used tft.readRect() to read a block of pixels to an array. When I used tft.pushRect() to push it back to the screen I saw the block is in a wrong color. The fanny thing is, when I read the block that pushed to the TFT, then push it back to the screen again I can see the correct color. See my codes:
#include <Arduino.h>
#include <TFT_eSPI.h>
#include "drawJpeg.h" // includes SPIFFS.h, JPEGDecoder.h, etc
TFT_eSPI tft = TFT_eSPI();
#define BLOCKPOSX 120
#define BLOCKPOSY 100
#define BLOCKWIDTH 128
#define BLOCKHEIGHT 128
uint16_t block[BLOCKWIDTH * BLOCKHEIGHT]; // array to store pixel data in RGB565 format
void setup() {
Serial.begin(115200);
}
void loop() {}
This is the SPI settings in "User_Setup.h"
#define SPI_FREQUENCY 40000000
#define SPI_READ_FREQUENCY 20000000*/
I cannot see anything wrong with my code.
Please help.
Beta Was this translation helpful? Give feedback.
All reactions