Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 17:11 17 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Displaybox in 5.3B

Author Message
busa
Regular Member

Joined: 12/02/2015
Location: Australia
Posts: 81
Posted: 05:33pm 19 Jan 2017
Copy link to clipboard 
Print this post

Explore100
When I use a GUI DISPLAYBOX to display the time and date via a SETTICK 1000, I notice that every few seconds the displaybox will flicker two or three times. Has anyone else noticed this behavior?

The below code snippet was where I first noticed it, maybe someone out there can try it and see if they get the flickering effect or tell me why is it so.
I have a similar piece of code running on a Micromite backpack and it is rock solid.


Option autorun on
font 4
Const display2 = 4
Colour RGB(white),RGB(blue)
SetTick 1000,clock
CLS
GUI displaybox display2, 240,5,350,50

Do
'do something
Loop

Sub clock
CtrlVal(display2) = Time$ + " " + Date$
End Sub
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8603
Posted: 10:31pm 19 Jan 2017
Copy link to clipboard 
Print this post

If you are using the latest beta and can make a connection to RD on the display (assuming SSD1963) try using the new GETSCANLINE function ( see latest manual). This allows you to synchronise writing to the display with the scan of the LCD.
I don't know how well this works with GUI controls but it certainly works well with normal drawing. The attached code could be suitable for a 800x480 display

Option autorun on
font 4
Const display2 = 4
Colour RGB(white),RGB(blue)
SetTick 1000,clock
CLS
GUI displaybox display2, 240,5,350,50

Do
'do something
Loop

Sub clock
local integer i
do
i=getscanline()
loop while (i>409 or i<400)
CtrlVal(display2) = Time$ + " " + Date$
End Sub
 
busa
Regular Member

Joined: 12/02/2015
Location: Australia
Posts: 81
Posted: 12:32am 20 Jan 2017
Copy link to clipboard 
Print this post

Thanks matherp, that solution half works. By that I mean the GUI DISPLAYBOX and TIME$ are no longer flickering but DATE$ blinks in time with the seconds even though they are both in the same BASIC command, ie CtrlVal(display2) = Time$ + " " + Date$. However if I use the TEXT command to display the time and date both are flicker free. Hope this is all making sense.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8603
Posted: 12:58am 20 Jan 2017
Copy link to clipboard 
Print this post

Try playing with the values 409 and 400. What you are looking for is a point in the cycle where the screen can update without the scanline passing over that part of the screen. Depending on where on the screen your fields are will alter the best settingEdited by matherp 2017-01-21
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024