Page 1 of 1

ili9341 various macros

Posted: Fri Jun 10, 2022 8:53 am
by jollybv
Hi Guys

Can someone please explain what the window macro in the ili9341 does as I've tried it out but nothing happens.

Re: ili9341 various macros

Posted: Fri Jun 10, 2022 10:28 am
by BenR
Hello,

The Window macro basically defines an area of the display where pixel data will be drawn.

Macros like plot will create a window of 1x1 pixel before sending the foreground colour.

Macros like fastplot will just send the colour without creating the window.

Re: ili9341 various macros

Posted: Wed Jun 15, 2022 6:55 am
by jollybv
Thanks Ben

Is there a way to draw a triangle like an up down arrow or a button with rounded corners? I have tried the ellipse but dose not give me the results I'm looking for.

Re: ili9341 various macros

Posted: Wed Jun 15, 2022 10:10 am
by BenR
Hello,

An arrow could be done using lines or plot points.

Arrow.jpg
Arrow.jpg (7.26 KiB) Viewed 1960 times

A rounded box could be done by adding black lines to the outside of a rectangle and white to the inside as shown here. This is a bad example hand drawn by me but shows you what kind of things you can do.

Rounded Box.jpg
Rounded Box.jpg (5.4 KiB) Viewed 1960 times

Here's a much better example from the web.

Rounded2.jpg
Rounded2.jpg (3.84 KiB) Viewed 1959 times

Ideally you use COS and SIN to do the X,Y dims for you.

If you think these are something that should be standard on all GLCDs then let us know and we can maybe investigate.

Re: ili9341 various macros

Posted: Tue Jun 21, 2022 8:19 am
by jollybv
Hi Ben

Sorry for the delayed reply as I have been away for a few days. It would be great if you could make it standard in the GLCDs as I'm not an advanced programmer like many others and have no clue how to use COS & SIN as of yet.

Re: ili9341 various macros

Posted: Thu Jul 14, 2022 6:55 am
by jollybv
Hi Guys

Is it possible to use sprites in flowcode as per video
https://www.youtube.com/watch?v=sRGXQg7 ... f&index=16

Re: ili9341 various macros

Posted: Thu Jul 14, 2022 9:58 am
by BenR
Hello,

Yes bitmaps can currently be used using the Bitmap Drawer components. Is this what you need?

I've also spotted a lib for doing antialiased rounded rectangles so just need to get my head around it.

Re: ili9341 various macros

Posted: Fri Jul 15, 2022 6:45 am
by jollybv
Hi Ben

What i was referring to in the video is the way he clears the whole screen using Sprits to stop the the flickering. I have tried using the clear screen but that is really slow so now I'm clearing every line individual and that a lot of code but don't get the flickering and its quick.

Re: ili9341 various macros

Posted: Fri Jul 15, 2022 9:59 am
by BenR
I'll have a proper watch of the video and see if there's anything we can learn and apply to our libraries.

Doing a full screen write in one go would certainly reduce flicker and code complexity but would also require a lot of ram and so wouldn't work for a lot of MCU targets.

320 x 240 pixels * 16-bit colour = a RAM buffer of 150KB

For MCU devices that can support this it would be a great addition. I'll have a think of a nice way to try and do this maybe a display buffer component with routines to draw the full screen and then send to the display all in one go.

It might be possible to double buffer the display hardware as that would provide a very simple means to acheive full screen redraws. I'll check if the ILI displays can allow this.

edit, it looks like people have tried and the ILI9341 cannot do double buffering itself without sacrificing half of the screen.
https://www.reddit.com/r/arduino/commen ... i9341_tft/