anton-semeniak / Esphome-TTGO-T-Display-Weather

18 stars 7 forks source link

how to use a 240x320 pixel st7789v #2

Open Electronlibre2012 opened 3 years ago

Electronlibre2012 commented 3 years ago

Helo @anton-semeniak ,

i know its not an issue but dont know where ask, and @musk95 doesnt respond...

i have a 240x320 st7789v, of course its only 135x240 on the screen if i put an image on.

I have modify the 240 and 320 value in "st7789v.cpp" line 265 and 269 but it boot loop.

Do you know what i have to modify to make it work please?

Thanks

anton-semeniak commented 3 years ago

Hi Check st7789v.h lines 8,11, and 16 That may help you, but I'm not sure, I have no screen 135x240 to test. Can you please send a link to the screen model?

Electronlibre2012 commented 3 years ago

Thanks for your fast reply,

its a 240x320 : https://fr.aliexpress.com/item/1005001677990601.html?spm=a2g0s.9042311.0.0.27426c37Txv1mR

Electronlibre2012 commented 3 years ago

i change the st7789v.h


#define TFT_WIDTH  240
#define TFT_HEIGHT 320

all the screen is filled, but there is no image, just lines black, white and some color pixel

anton-semeniak commented 3 years ago

Sorry I did a mistake, I have 135x240, but you have 240 x 320. I have no idea. I did not write this library, I just little bit adapt it for my display. I have only one more idea for you, try to swap high and width. like :

define TFT_WIDTH 320

define TFT_HEIGHT 240

try to change st7789v.h first and run, after that if it doesn't help try to modify "st7789v.cpp" line 265 and 269 in the same way.

Electronlibre2012 commented 3 years ago

thanks for your help but it doesnt work...

my knowledge is limited in driver understanding and i give up...hope @musk95 will give an answer...

Strange that nobody is more interested to use this great display in HA...

anton-semeniak commented 3 years ago

I have ordered one. Let me know if you will have this issue resolved.

Electronlibre2012 commented 3 years ago

great!

will wait for your tests ;)

Thanks for your help anyway! happy Christmas

anton-semeniak commented 3 years ago

Try to play with this part in st7789v.cpp :

void ST7789V::write_display_data() { uint16_t x1 = 52;// +dev->_offsetx; uint16_t x2 = 186;// + dev->_offsetx; uint16_t y1 = 40;// + dev->_offsety; uint16_t y2 = 279;// + dev->_offsety;