In the test project, I use a timer to produce a steady flicker.
However, the flicker is not stable.
What suggestion?
However, the flicker is not stable.
What suggestion?
Timer:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
' Dim timer_image As Timer
Dim timer_blink As Timer
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim blink_step As Int :blink_step = 0
Dim led_txt As Int :led_txt=50
' Private lblLED As Label
' Private lblTXT As Label
Private lblLED As Label
Private lblTXT As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("tttest1")
timer_blink.Initialize("timer_blink",1)
timer_blink.Enabled=False
load_scene
End Sub
Sub Activity_Resume
timer_blink.Enabled=True
End Sub
Sub Activity_Pause (UserClosed As Boolean)
timer_blink.Enabled=False
End Sub
private Sub load_scene
' lblLED.Initialize("lblLED")
lblLED.Top=0
lblLED.Left=0
lblLED.Width=100%x
lblLED.Height=100%y
lblLED.Color=Colors.White
' lblTXT.Initialize("lblTXT")
lblTXT.Top=lblLED.Top+led_txt
lblTXT.Left=lblLED.Left+led_txt
lblTXT.Width=lblLED.Width-(led_txt*2)
lblTXT.Height=lblLED.Height-(led_txt*2)
lblTXT.Color=Colors.Black
lblTXT.Visible=True
End Sub
Sub timer_blink_Tick
blink_step=blink_step+1
If blink_step=12 Then
lblLED.Visible=False
End If
If blink_step=25 Then
lblLED.Visible=True
blink_step=0
End If
End Sub