ST7789 display

For general Flowcode discussion that does not belong in the other sections.
Post Reply
jan.didden
Posts: 82
http://meble-kuchenne.info.pl
Joined: Thu Dec 17, 2020 3:16 pm
Has thanked: 20 times
Been thanked: 12 times

Re: ST7789 display

Post by jan.didden »

Hi Martin, yes that could be an option, I really only need the + and - signs and 0 tom 9 digits to read an attenuation value from a few meters away.
Something along the lines as the attached; that's not a very high resolution display but lookes quite professional. But maybe there exists a utility that takes a given bitmap and generates an arbitrary larger one? That should be very handy.

Jan
Attachments
largefont.PNG
largefont.PNG (25.27 KiB) Viewed 1232 times

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: ST7789 display

Post by mnfisher »

Hi Jan,

I'd probably convert the required characters by 'drawing' them at the required size and font (using the text option), in a graphics package (paint should do it) and then saving as a bmp. Alternatively use something like ImageMagick to do the conversion...

Martin

jan.didden
Posts: 82
Joined: Thu Dec 17, 2020 3:16 pm
Has thanked: 20 times
Been thanked: 12 times

Re: ST7789 display

Post by jan.didden »

OK, I think I can do that. How do I then access such a bitmap for printing in FC?

Edit: there's a bunch of bitmap drawer functions in the gLCD lib. Back to the drawing board!

Jan

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: ST7789 display

Post by BenR »

Hello,

Click on the GLCD component and look at it's properties, There you can assign different fonts. Some of the number fonts are very large and will print large without being blocky. The number by the font is the default height in pixels.

FontSetup.jpg
FontSetup.jpg (26.54 KiB) Viewed 1220 times

jandidden
Posts: 110
Joined: Mon Feb 13, 2023 7:56 pm
Has thanked: 28 times
Been thanked: 12 times

Re: ST7789 display

Post by jandidden »

Thanks Ben, that works, I hadn't noticed that. It appears that you can select up to 4 fonts as 'font count' and then select any one on the fly. Neat!

Getting an ST7789 display wired up and displaying some text works, but with something funny. My display (ADAfruit) has 240 x 170 pixels which sound to me as landscape, and I entered 240 at the pixel width and 170 at the pixel height box in the properties window, yet the image is displayed in portrait mode. Changing to 170 pixel width and 240 pixel heigt doesn't change anything!
How is that possible? Is there a separate variable for display orientation that I missed?

(There's also the lower quarter of the display (portrait) that shows junk and stripes, but 1st things first).
Can anyone point me in the right direction wrt the orientation?

Jan

WingNut
Posts: 254
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 33 times
Been thanked: 23 times

Re: ST7789 display

Post by WingNut »

There are 2 places for display orientation. One is in the properties and the other is the macro

jandidden
Posts: 110
Joined: Mon Feb 13, 2023 7:56 pm
Has thanked: 28 times
Been thanked: 12 times

Re: ST7789 display

Post by jandidden »

Really? Can you be a bit specific? I don't see it in the Properties, attached.
Which macro are you referring to?

Jan
Attachments
ST7789.PNG
ST7789.PNG (79.13 KiB) Viewed 1189 times

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: ST7789 display

Post by chipfryer27 »

Hi

In v10, the component propereties has at the very bottom an option to orientate the display during simulation to match Hardware. This isn't available in v9.

However in both v9 and v10, the Component Macro itself has a "SetDisplayOrientation" option that rotates the display in hardware between 0 and 270 degrees.

Regards

WingNut
Posts: 254
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 33 times
Been thanked: 23 times

Re: ST7789 display

Post by WingNut »

Looking at your image it looks like you have scrolled down to the bottom of the properties and dont have any further to go. On my screen its below the fonts and a set of properties called simulation and appears below font 3. The property is physical orientation.
are you fully updated with the core updates?

jandidden
Posts: 110
Joined: Mon Feb 13, 2023 7:56 pm
Has thanked: 28 times
Been thanked: 12 times

Re: ST7789 display

Post by jandidden »

OK, thanks @Chipfryer27, found the SetDisplayOrientation ... don't know why I missed that.
(@Wungnut I wasn't interested in the sim so I disregarded that).

Next up is the 'hash' as shown in the attached. I did a ClearDisplay after Initialise to try to get rid of it but that didn't do it.
I also have a suspicion that the wiring is not well dressed becasue of the visible blue short stripes between the characters, so that may also be a factor.

Jan
Attachments
hash.jpg
hash.jpg (176.29 KiB) Viewed 1198 times

Post Reply