سلام. من یه مشکلی با این برنامه دارم. وقتی pinb.1 رو یک میکنم Pinc.1 هم یک میشه . اما همین طوری یک میمونه. درحالی که من میخوام بعد از 300 میلی ثانیه دوباره صفر بشه. البته همینطوری که یک میمونه تگه دوباره pinb.1 رو یک کنم اینبار Pinc.1 صفر میشه
$regfile = "m8def.dat"
$crystal = 1000000
Dim I As Single
I = 0
'******tayin kelid haye segane******
Config Portb.1 = Input : Portb.1 = 0 : Key_up Alias Pinb.1
Config Portb.2 = Input : Portb.2 = 0 : Key_down Alias Pinb.2
Config Portb.3 = Input : Portb.3 = 0 : Key_stop Alias Pinb.3
'******************************************** *****************
'******Tayin sensor (ha)**************************************
Config Portb.4 = Input : Portb.4 = 0 : Ir_sen Alias Pinb.4
'******************************************** *****************
'******Tayin khorooji haye segane******
Config Portc.1 = Output : Portc.1 = 0 : R_up Alias Pinc.1
Config Portc.2 = Output : Portc.2 = 0 : R_down Alias Pinc.2
Config Portc.3 = Output : Portc.3 = 0 : R_stop Alias Pinc.3
'******************************************** *****************
Do
I = 0
'Reset R_up
'Reset R_down
'Reset R_stop
If Key_up = 1 Then
Waitms 1000
Gosub Up_opr
End If
If Key_down = 1 Then
Gosub Down_opr
End If
If Key_stop = 1 Then
Gosub Stop_opr
End If
Waitms 100
Loop
End
'******Submenu ha********************************************
Up_opr:
Pinc.1 = 1
Waitms 300
Pinc.1 = 0
Return
$regfile = "m8def.dat"
$crystal = 1000000
Dim I As Single
I = 0
'******tayin kelid haye segane******
Config Portb.1 = Input : Portb.1 = 0 : Key_up Alias Pinb.1
Config Portb.2 = Input : Portb.2 = 0 : Key_down Alias Pinb.2
Config Portb.3 = Input : Portb.3 = 0 : Key_stop Alias Pinb.3
'******************************************** *****************
'******Tayin sensor (ha)**************************************
Config Portb.4 = Input : Portb.4 = 0 : Ir_sen Alias Pinb.4
'******************************************** *****************
'******Tayin khorooji haye segane******
Config Portc.1 = Output : Portc.1 = 0 : R_up Alias Pinc.1
Config Portc.2 = Output : Portc.2 = 0 : R_down Alias Pinc.2
Config Portc.3 = Output : Portc.3 = 0 : R_stop Alias Pinc.3
'******************************************** *****************
Do
I = 0
'Reset R_up
'Reset R_down
'Reset R_stop
If Key_up = 1 Then
Waitms 1000
Gosub Up_opr
End If
If Key_down = 1 Then
Gosub Down_opr
End If
If Key_stop = 1 Then
Gosub Stop_opr
End If
Waitms 100
Loop
End
'******Submenu ha********************************************
Up_opr:
Pinc.1 = 1
Waitms 300
Pinc.1 = 0
Return
دیدگاه