Posted: 08:49am 04 Feb 2017 |
Copy link to clipboard |
 Print this post |
|
I added a print statement to the loop to show the scan lines while in the loop.. It seems to be working ok while you are using the TEXT command to display the current time and date data. While modifying a number box control, the display seems to be updating correctly while the number keypad object is "on screen", all without any flickering on screen..
So far, so good... (sweet)..!
Next I tried creating a display box control and changing the code to display the time and date data updates in this object. While testing out this method, I noticed that the screen flickering has returned...
I am not sure if this is the correct way to do this while using just only GUI based objects... The example code has certain lines commented out and is operating with the TEXT command... You can change it quickly to enable the display box control...
' RTC Setup Test
Option explicit Const time_display_box=1 Const yer_val_box=2 Const yer_label_box=3 Const mth_val_box=4 Const mth_label_box=5 Const day_val_box=6 Const day_label_box=7 Const hrs_val_box=8 Const hrs_label_box=9 Const min_val_box=10 Const min_label_box=11
'Dim old_date As string length 10 'Dim old_time As string length 10 'Dim not_touched =1 Dim refresh_line As integer
CLS
GUI setup 1 'GUI displaybox time_display_box,0,0,200,20,RGB(yellow),RGB(black) 'CtrlVal(time_display_box)="test"
Font 5 GUI numberbox yer_val_box,20,30,100,50,RGB(yellow),RGB(blue) CtrlVal(yer_val_box)=Val(Mid$(Date$,7,4)) ' extract year data
Font 1 GUI interrupt pen_down,pen_up SetTick 1000,check_time
Do
Loop
Sub check_time refresh_line=GetScanLine() 'Do While refresh_line>400 Or refresh_line<=MM.FontHeight*2 'nd refresh_line<= Do While refresh_line<=MM.FontHeight*2 Print refresh_line refresh_line=GetScanLine() Loop Print Time$ 'CtrlVal(time_display_box)=Time$+" "+Date$ Text 0,0,Time$+" "+Date$ End Sub
'Sub MM.KEYPRESS ref As integer, caption As string 'Print caption ' If ref=yer_val_box And caption="Ent" Then ' If Val(CtrlVal(yer_val_box))>4000 Then CtrlVal(yer_val_box)="4000" ' If Val(CtrlVal(yer_val_box))<0 Then CtrlVal(yer_val_box)="0" ' EndIf 'End Sub
Sub pen_down Print "down" End Sub
Sub pen_up Print "up" End Sub
Any feedback would be awesome..!!
Thanks Gents..! |