سلام و خسته نباشید خدمت اساتید محترم
برای نوشتن یک برنامه ساده به مشکل برخوردم
ممنون میشم کمکم کنید
میخوام دستورات :
Set Portd.0
Waitms 500
Reset Portd.0
Set Portd.1
Waitms 500
Reset Portd.1
Set Portd.0
Waitms 500
Reset Portd.0
Set Portd.2
Waitms 500
Reset Portd.2
رو جای قسمت علامت سوال قرار بدم
به طوری که با اولین فشرده شدن کلید pina.0 فقط بار اوا اجرا بشن و بار دو تا بی نهایت دستور
Set Portd.2
Waitms 200
Reset Portd.2
اجرا بشه
این هم خود برنامه:
'########################
$regfile = "m32def.dat"
$crystal = 1000000
'######################
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portc.0 , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.3 , E = Portc.4 , Rs = Portc.5
Cursor Off
Cls
Config Portd.0 = Output
Config Portd.1 = Output
Config Portd.2 = Output
Config Portd.3 = Output
Config Pina.0 = Input
Config Pina.1 = Input
'###############################
Dim A As Integer
A = 0
'//////////////////////////////
Main:
Do
If Pina.0 = 1 Then
Gosub Up
End If
Loop
'/////////////////////////////////
Up:
A = A + 1
Locate 1 , 1
Lcd A
'////////////////////////////////
'?????????
'////////////////////////////////
Set Portd.2
Waitms 200
Reset Portd.2
Return
End
برای نوشتن یک برنامه ساده به مشکل برخوردم
ممنون میشم کمکم کنید
میخوام دستورات :
Set Portd.0
Waitms 500
Reset Portd.0
Set Portd.1
Waitms 500
Reset Portd.1
Set Portd.0
Waitms 500
Reset Portd.0
Set Portd.2
Waitms 500
Reset Portd.2
رو جای قسمت علامت سوال قرار بدم
به طوری که با اولین فشرده شدن کلید pina.0 فقط بار اوا اجرا بشن و بار دو تا بی نهایت دستور
Set Portd.2
Waitms 200
Reset Portd.2
اجرا بشه
این هم خود برنامه:
'########################
$regfile = "m32def.dat"
$crystal = 1000000
'######################
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portc.0 , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.3 , E = Portc.4 , Rs = Portc.5
Cursor Off
Cls
Config Portd.0 = Output
Config Portd.1 = Output
Config Portd.2 = Output
Config Portd.3 = Output
Config Pina.0 = Input
Config Pina.1 = Input
'###############################
Dim A As Integer
A = 0
'//////////////////////////////
Main:
Do
If Pina.0 = 1 Then
Gosub Up
End If
Loop
'/////////////////////////////////
Up:
A = A + 1
Locate 1 , 1
Lcd A
'////////////////////////////////
'?????????
'////////////////////////////////
Set Portd.2
Waitms 200
Reset Portd.2
Return
End
دیدگاه