دوستان توروخدا كمك كنين مشكلم خيلي اضطراريه
برنامه روباتو نوشتيم (فكر كنم درست نباشه)و پروگرام كرديم ولي وقتي ميكرو رو به روبات وصل ميكنيم هيچ عملي اتفاق نميفته. برنامه رو توي بسكام با زبان بيسيك نوشتيم. البته اينم بگم كه اين اولين باره كه برنامه نويسي ميكنيم
به هر حال ممنون ميشم كمك كنين
اينم خود برنامه:
$prog &HFF , &HC4 , &H99 , &H00
$regfile = M32def.det
$crystal = 8000000
'******************************
Config Porta = Input
Config Portd = Output
Config Timer1 = Pwm , Pwm = 10 , Compare A Pwm = Clear Down , Compare B Pwm = Clear Down , Prescale = 1
'*****************************
N Alias Pina.0
H Alias Pina.1
B Alias Pina.2
Y Alias Pina.3
G Alias Pina.4
V Alias Pina.5
S Alias Pina.6
Lmj Alias Pind.1
Lma Alias Pind.6
Rmj Alias Pind.3
Rma Alias Pind.2
'*****************************
Declare Sub Jelo
Declare Sub Chap
Declare Sub Rast
Declare Sub Jelo2
Declare Sub Chap2
Declare Sub Rast2
'*****************************
Do
If Y = 1 And B = 1 And G = 1 And V = 1 And H = 1 And N = 1 Then Call Jelo
If Y = 0 And B = 0 And G = 1 And V = 1 And H = 1 And N = 1 Then Call Jelo
If Y = 0 And B = 1 And G = 1 And V = 1 And H = 1 And N = 1 Then Call Jelo2
If B = 0 And Y = 1 And G = 1 And V = 1 And H = 1 And N = 1 Then Call Jelo2
If B = 0 And H = 0 And G = 1 And V = 1 And Y = 1 And N = 1 Then Call Rast2
If B = 0 And G = 0 And Y = 1 And V = 1 And H = 1 And N = 1 Then Call Chap2
If B = 0 And N = 0 And G = 1 And V = 1 And H = 1 And Y = 1 Then Call Rast
If B = 0 And V = 0 And G = 1 And Y = 1 And H = 1 And N = 1 Then Call Chap
If B = 1 And V = 1 And G = 0 And Y = 1 And H = 1 And N = 1 Then Call Chap2
If B = 1 And V = 0 And G = 1 And Y = 1 And H = 1 And N = 1 Then Call Chap2
If B = 1 And V = 1 And G = 1 And Y = 1 And H = 0 And N = 1 Then Call Rast2
If B = 1 And V = 1 And G = 1 And Y = 1 And H = 1 And N = 0 Then Call Rast2
If B = 1 And V = 0 And G = 0 And Y = 1 And H = 1 And N = 1 Then Call Chap2
If B = 1 And V = 1 And G = 1 And Y = 1 And H = 0 And N = 0 Then Call Rast2
If Y = 0 And B = 1 And G = 0 And V = 0 And H = 1 And N = 1 Then Call Chap2
If Y = 0 And B = 1 And G = 1 And V = 1 And H = 0 And N = 0 Then Call Rast2
If Y = 1 And B = 0 And G = 1 And V = 0 And H = 0 And N = 1 Then Call Chap2
If Y = 1 And B = 0 And G = 0 And V = 1 And H = 1 And N = 0 Then Call Rast2
If Y = 0 And B = 1 And G = 0 And V = 1 And H = 1 And N = 1 Then Call Chap2
If Y = 0 And B = 1 And G = 1 And V = 1 And H = 0 And N = 1 Then Call Rast2
If Y = 0 And B = 0 And G = 0 And V = 0 And H = 0 And N = 0 Then Call Jelo
If Y = 1 And B = 1 And G = 0 And V = 0 And H = 0 And N = 0 Then Call Jelo
If Y = 1 And B = 0 And G = 0 And V = 0 And H = 0 And N = 0 Then Call Jelo2
If B = 1 And Y = 0 And G = 0 And V = 0 And H = 0 And N = 0 Then Call Jelo2
If B = 1 And H = 1 And G = 0 And V = 0 And Y = 0 And N = 0 Then Call Rast2
If B = 1 And G = 1 And Y = 0 And V = 0 And H = 0 And N = 0 Then Call Chap2
If B = 1 And N = 1 And G = 0 And V = 0 And H = 0 And Y = 0 Then Call Rast
If B = 1 And V = 1 And G = 0 And Y = 0 And H = 0 And N = 0 Then Call Chap [/php][/code]
If B = 0 And V = 0 And G = 1 And Y = 0 And H = 0 And N = 0 Then Call Chap2
If B = 0 And V = 1 And G = 0 And Y = 0 And H = 0 And N = 0 Then Call Chap2
If B = 0 And V = 0 And G = 0 And Y = 0 And H = 1 And N = 0 Then Call Rast2
If B = 0 And V = 0 And G = 0 And Y = 0 And H = 0 And N = 1 Then Call Rast2
If B = 0 And V = 1 And G = 1 And Y = 0 And H = 0 And N = 0 Then Call Chap2
If B = 0 And V = 0 And G = 0 And Y = 0 And H = 1 And N = 1 Then Call Rast2
If Y = 1 And B = 0 And G = 1 And V = 1 And H = 0 And N = 0 Then Call Chap2
If Y = 1 And B = 0 And G = 0 And V = 0 And H = 1 And N = 1 Then Call Rast2
If Y = 0 And B = 1 And G = 0 And V = 1 And H = 1 And N = 0 Then Call Chap2
If Y = 0 And B = 1 And G = 1 And V = 0 And H = 0 And N = 1 Then Call Rast2
If Y = 1 And B = 0 And G = 1 And V = 0 And H = 0 And N = 0 Then Call Chap2
If Y = 1 And B = 0 And G = 0 And V = 0 And H = 1 And N = 0 Then Call Rast2
Loop
End
'*****************************
Sub Jelo
Lmj = 1
Rmj = 1
Lma = 0
Rma = 0
Pwm1a = 1000
Pwm1b = 1000
Return
End Sub
'*****************************
Sub Jelo2
Lmj = 1
Rmj = 1
Lma = 0
Rma = 0
Pwm1a = 500
Pwm1b = 500
Return
End Sub
'*****************************
Sub Chap
Lmj = 0
Rmj = 1
Lma = 0
Rma = 0
Pwm1a = 1000
Pwm1b = 1000
Waitms 500
Return
End Sub
'*****************************
Sub Chap2
Lmj = 1
Rmj = 1
Lma = 0
Rma = 0
Pwm1a = 250
Pwm1b = 500
Waitms 500
Return
End Sub
'*****************************
Sub Rast
Lmj = 1
Rmj = 0
Lma = 0
Rma = 0
Pwm1a = 1000
Pwm1b = 1000
Waitms 500
Return
End Sub
'*****************************
Sub Rast2
Lmj = 1
Rmj = 1
Lma = 0
Rma = 0
Pwm1a = 500
Pwm1b = 250
Waitms 500
Return
End Sub
'*****************************
End