سلام. کسی می تونه این برنامه رو با پروتوس اجرا کنه. یه led به پین portb.0 وصل است که با دو کلید که به INT0 و INT1 وصل شده. با زدن کلید ها باید سرعت چشمک زدن کم یا زیاد بشود.
لطفا کمکم کنید.
$regfile = "m32def.dat"
$crystal = 8000000
Enable Interrupts
Enable Int0
Enable Int1
On Int0 Up
On Int1 Down
Config Int0 = Rising
Config Int1 = Rising
Config portb.0 = output
Dim Delay_time As Word
Delay_time = 50
Do
Portb.0 = 1
Waitms Delay_time
Portb.0 = 0
Waitms Delay_time
Loop
End
Up:
Delay_time = Delay_time + 5
Return
Down:
Delay_time = Delay_time - 5
Return
لطفا کمکم کنید.
$regfile = "m32def.dat"
$crystal = 8000000
Enable Interrupts
Enable Int0
Enable Int1
On Int0 Up
On Int1 Down
Config Int0 = Rising
Config Int1 = Rising
Config portb.0 = output
Dim Delay_time As Word
Delay_time = 50
Do
Portb.0 = 1
Waitms Delay_time
Portb.0 = 0
Waitms Delay_time
Loop
End
Up:
Delay_time = Delay_time + 5
Return
Down:
Delay_time = Delay_time - 5
Return
دیدگاه