Round display GC9A01

All that relates to the H/W
User avatar
Fernando Perez
Posts: 378
Joined: Mon Feb 15, 2021 10:09 pm
Location: Santander (Spain)
Has thanked: 195 times
Been thanked: 267 times

Round display GC9A01

Post by Fernando Perez »

I bought two screens of this type on AliExpress at a really low price.
Running on Annex32 CAN 1.50.8 LFS and Wemos D1mini ESP32 without problems, with this setup:
image.png
image.png


Attached demo program. Amazing image quality, much better than what is seen in the video. It is due to problems with my camera and lighting.

Code: [Local Link Removed for Guests]

second = 0 : lastSecond = 0
h$ = "" : s$ = ""
background = tft.rgb(215,216,211)

tft.loadFont "/DS_DIGIB19pt7b.bin", 10
tft.loadFont "/DS_DIGIB27pt7b.bin", 11
tft.init 0
tft.fill 0
pause 3000

tft.jpg "/mosca.jpg"
pause 5000
tft.image "/Jo_van_Gogh.jpg"
pause 5000

tft.jpg "/casio.jpg"
gui.init 2
s = gui.textLine(157, 125, 45, 30, s$, 10, black, background, background)
h = gui.textLine(42, 117, 113, 38, h$, 11, black, background, background, ALIGN_MID_RIGHT, 2)
gosub displayHours

while 1
  second = val(right$(time$, 1))
  seconds = val(right$(time$, 2))
  if second <> lastSecond then gosub displaySeconds
  if seconds = 0 then gosub displayHours
wend  

displaySeconds:
  gui.settext s, right$(time$, 2)
  gui.refresh
  lastSecond = second
return  

displayHours:
  h$ = str$(val(left$(time$, 2))) + mid$(time$, 3, 3) ' pipsqueak
  gui.setText h, h$
  gui.refresh
return
GC9A01.zip
https://youtube.com/shorts/tfc9oxDMu5E?feature=share

Just two observations: I'm missing the tft.pixel(x, y, color) instruction and when I try to load a 32-bit bmp image with a transparent background, Annex doesn't detect it.
You do not have the required permissions to view the files attached to this post.
User avatar
cicciocb
Site Admin
Posts: 1989
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 426 times
Been thanked: 1329 times
Contact:

Re: Round display GC9A01

Post by cicciocb »

Ho Fernando,
the command is without the ()

Code: [Local Link Removed for Guests]

tft.pixel x, y, color
About the transparent color, all depends on what you define for transparent image.
Post it here and I'll check if your image has an alpha channel.
User avatar
Fernando Perez
Posts: 378
Joined: Mon Feb 15, 2021 10:09 pm
Location: Santander (Spain)
Has thanked: 195 times
Been thanked: 267 times

Re: Round display GC9A01

Post by Fernando Perez »

True, Francesco, with that syntax tft.pixel works for me. I was confused because I can't find it in Help.
I upload a .bmp image that I think is 32 bit, 240x240 with a transparent background. At least, I set the alpha channel to 0, but my knowledge is very limited.
Europa32b.7z
You do not have the required permissions to view the files attached to this post.
User avatar
cicciocb
Site Admin
Posts: 1989
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 426 times
Been thanked: 1329 times
Contact:

Re: Round display GC9A01

Post by cicciocb »

Yes, the command is missing in the help. I'll update the help.

About the image, the image is transparent but I don't understand what is the issue as the image is exactly the size of the TFT so the transparent part is outside the screen
User avatar
Fernando Perez
Posts: 378
Joined: Mon Feb 15, 2021 10:09 pm
Location: Santander (Spain)
Has thanked: 195 times
Been thanked: 267 times

Re: Round display GC9A01

Post by Fernando Perez »

You are right the image is round and 240x240. It is not a good example.
But my problem is that when I load a 24 bit bmp image, it appears on the screen. The same image in 32 bits is ignored. It does not appear on the screen and there is no error message.

Code: [Local Link Removed for Guests]

tft.init 0
tft.fill 0

tft.bmp "/borron24.bmp", 0, 0  '  You can see it well
pause 1000
tft.fill blue
pause 1000
' Can't see anything, screen goes from blue to yellow background without transition:
tft.bmp "/borron32T.bmp", 0, 0, -1  ' 
pause 1000
tft.fill yellow
END

I'm almost sure the problem is that I can't make 32-bit transparent bmp images with the means I use, Paint Net.
I will try to install GIMP.
You do not have the required permissions to view the files attached to this post.
User avatar
Fernando Perez
Posts: 378
Joined: Mon Feb 15, 2021 10:09 pm
Location: Santander (Spain)
Has thanked: 195 times
Been thanked: 267 times

Re: Round display GC9A01

Post by Fernando Perez »

I've installed GIMP, created a 32-bit BMP image with a transparent background, and still get a black screen. I'm sorry to bother you so much, but can you post or send me an image of these characteristics that works for you? Thank you.
User avatar
cicciocb
Site Admin
Posts: 1989
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 426 times
Been thanked: 1329 times
Contact:

Re: Round display GC9A01

Post by cicciocb »

as soon as i'll have the time I'll test, maybe is not working.
User avatar
cicciocb
Site Admin
Posts: 1989
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 426 times
Been thanked: 1329 times
Contact:

Re: Round display GC9A01

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Fri Aug 25, 2023 8:23 am I've installed GIMP, created a 32-bit BMP image with a transparent background, and still get a black screen. I'm sorry to bother you so much, but can you post or send me an image of these characteristics that works for you? Thank you.
I tried your images and are not working.
So I tried to see how is coded and I discovered that the format 32bits actually implemented in Annex is not exactly the format that gimp exports, I did that some years ago and honestly I don't remember if I was using an older version of Gimp or another tool for the images.
Having said that, I just "patched" your image and it works (Is attached).
I think that is not practical to patch all the images (change the byte at address 0x1e from 3 to 0) :lol:
So I need to update a little bit annex to make it compatible with gimp. I'll include also the format 16 bits for more compact images.
As I did a deep learning on the bmp format recently, this is the good moment before I'll change completely the subject.
You do not have the required permissions to view the files attached to this post.
User avatar
Fernando Perez
Posts: 378
Joined: Mon Feb 15, 2021 10:09 pm
Location: Santander (Spain)
Has thanked: 195 times
Been thanked: 267 times

Re: Round display GC9A01

Post by Fernando Perez »

Works! Beautiful.
What's more, I've dug up the "hexadecimal editor" function of my favorite editor, PSPad and I can make my images transparent with your instructions.
I don't know where you learn so many things...
Like always, thank you.
image.png
I take this opportunity to comment on how easy it is to create a screen to display QR codes and how well they look on this round TFT.

Code: [Local Link Removed for Guests]

background = tft.rgb(215,216,211)
tft.init 0
tft.fill background
for v = 1 to 15
  tft.qrcode "192.168.1.103", 33, 33, 170, v
  pause 3000
next v  
You do not have the required permissions to view the files attached to this post.
Helmut_number_one
Posts: 93
Joined: Fri Dec 09, 2022 10:03 am
Has thanked: 36 times
Been thanked: 8 times

Re: Round display GC9A01

Post by Helmut_number_one »

I can't use the code, in Annex32 CAN 1.50.8 LFS and in newer Firmware, TFT Int, TFT.TJPG and so on.
Post Reply