سلام
برنامه ی ساده برای اینتراپت نوشتم اما نمیدونم مشکل کجاست oo:
وقتی کلیدی رو فشار میدم این بعضی اوقات 2 یا 3 یا 1 مرتبه متغییر رو افزایش میده :eek:
دوستان مشکل از چی می تونه باشه؟؟؟؟
$regfile = "m16def.dat"
$crystal = 8000000
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Pina.3 , Db5 = Pina.2 , Db6 = Pina.1 , Db7 = Pina.0 , Rs = Pina.5 , E = Pina.4
Config Pind.0 = Input
Config Pind.1 = Input
Config Pind.4 = Input
Config Portd.5 = Output
Config Portd.6 = Output
Config Portd.7 = Output
Config Int0 = Rising
Config Int1 = Rising
Dim A As Byte , B As Byte , C As Byte , D As Byte
Enable Interrupts
Enable Int0
Enable Int1
On Int0 Q
On Int1 W
Cls
Home : Lcd "AVR , ARM" : Wait 1
Cls
D = 0
Do
Locate 1 , 1 : Lcd D ; " " ; C : Wait 1
Loop
End 'end program
'***********************
Q:
Incr D
Cls : Lcd D
Return
'***********************
W:
Disable Int1
Waitms 500
Incr C
Cls : Lcd C
Enable Int1
Return
'***********************
برنامه ی ساده برای اینتراپت نوشتم اما نمیدونم مشکل کجاست oo:
وقتی کلیدی رو فشار میدم این بعضی اوقات 2 یا 3 یا 1 مرتبه متغییر رو افزایش میده :eek:
دوستان مشکل از چی می تونه باشه؟؟؟؟
$regfile = "m16def.dat"
$crystal = 8000000
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Pina.3 , Db5 = Pina.2 , Db6 = Pina.1 , Db7 = Pina.0 , Rs = Pina.5 , E = Pina.4
Config Pind.0 = Input
Config Pind.1 = Input
Config Pind.4 = Input
Config Portd.5 = Output
Config Portd.6 = Output
Config Portd.7 = Output
Config Int0 = Rising
Config Int1 = Rising
Dim A As Byte , B As Byte , C As Byte , D As Byte
Enable Interrupts
Enable Int0
Enable Int1
On Int0 Q
On Int1 W
Cls
Home : Lcd "AVR , ARM" : Wait 1
Cls
D = 0
Do
Locate 1 , 1 : Lcd D ; " " ; C : Wait 1
Loop
End 'end program
'***********************
Q:
Incr D
Cls : Lcd D
Return
'***********************
W:
Disable Int1
Waitms 500
Incr C
Cls : Lcd C
Enable Int1
Return
'***********************
دیدگاه