in the following codes the timer value is 1200
how can increase and decrease timer value by pressing up and down keys
'-----------------------[Definitions]
$regfile = "m32def.dat"
$crystal = 100000
$baud = 9600
'----------------------
'-----------------------[Timer1 Configuration]
Config Timer1 = Timer , Prescale = 1024
Start Timer1
'----------------------
'-----------------------[GPIO Configuration]
Config Porta.0 = Output : Led Alias Porta.0
'----------------------
'-----------------------[Variables]
Dim A As Byte
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'--->[Main Program]
Do
If Timer1 = 1200 Then 'Tcnt1
Timer1 = 0 : Toggle Led
End If
Loop
End
'---<[End Main]
↧