۱۸-تير-۱۳۸۶, ۲۲:۴۳:۰۷
قبل از سئوال اصلي مي خوتهم بدانم كه پس از برنامه نويسي اي سي براي كار كردن اي سي و عمل به برنامه اش بايد به كداميك از پايه هايش جريان وصل شود به طور كلي پايه هاي 10 و 30 و 31 و 32 كه با نام هاي VCC ,GND, AVCC, GND, AREF به چه كاري مي آيند :?:
در ضمن دستور Adc در bascom به چه منظوري مي باشد... :roll:
فرض كنيد كه من منتظر جواب در مورد همه ي سئوال هاي بالا به خصوص سئوال زيرم
و چت كردم تا جوابم بدين 8O
يه برنامه اي مي خوام كه اگر پايه ي b.0 برقرار بود (1) و پايه ي b.1 برقرار نبود (0) آنگاه a.0 بر قرار شود و اگر b.0 برقرار نبود و b.1 برقرار بود آنگاه a.1 برقرار شود و اگر هر دو بر قرار بودند a.0 and a.1 بر قرار شود :!:
البته خودم اين برنامه رو نوشتم ولي تو پروتس انچه كه من مي خوام نميشه :?:
آن هم به دو روش 8) اگر هم بگين اشتباهم چيه خوبه :
1)
$regfile = "8535DEF.DAT"
$crystal = 8000000
Config Porta = Output
Config Portb = Input
Dim S As Byte , S1 As Byte , S2 As Byte , S3 As Byte
S1 = Pinb.0
S2 = Pinb.1
S3 = Pinb.2
Do
If S1 = 1 And S2 = 0 And S2 = 0 Then Goto Chap
If S1 = 0 And S2 = 1 And S2 = 0 Then Goto Rast
If S1 = 1 And S2 = 1 And S2 = 0 Then Goto Aghab
If S1 = 0 And S2 = 0 And S2 = 1 Then Goto Random
If S1 = 1 And S2 = 0 And S2 = 1 Then Goto Chap
If S1 = 0 And S2 = 1 And S2 = 1 Then Goto Rast
If S1 = 1 And S2 = 1 And S2 = 1 Then Goto Aghab
Loop
End
Chap:
Set Pina.0
Reset Pina.1
Rast:
Set Pina.0
Reset Pina.1
Aghab:
Set Pina.0
Set Pina.1
Goto Random
Random:
S = Rnd(10)
If S > 5 Then Goto Chap
If S < 5 Then Goto Rast
2)
$regfile = "8535DEF.DAT"
$crystal = 8000000
Config Porta = Output
Config Portb = Input
Dim A As Byte , S As Byte
Do
A = 0
If Pinb.0 = 1 And Pinb.1 = 0 And Pinb.2 = 0 Then Goto Chap
If Pinb.0 = 0 And Pinb.1 = 1 And Pinb.2 = 0 Then Goto Rast
If Pinb.0 = 1 And Pinb.1 = 1 And Pinb.2 = 0 Then Goto Aghab
If Pinb.0 = 0 And Pinb.1 = 0 And Pinb.2 = 1 Then Goto Random
If Pinb.0 = 1 And Pinb.1 = 0 And Pinb.2 = 1 Then Goto Chap
If Pinb.0 = 0 And Pinb.1 = 1 And Pinb.2 = 1 Then Goto Rast
If Pinb.0 = 1 And Pinb.1 = 1 And Pinb.2 = 1 Then Goto Aghab
Loop
End
Chap:
For A = 0 To 20
Set Pina.0
Reset Pina.1
Incr A
Next A
Rast:
For A = 0 To 20
Set Pina.1
Reset Pina.0
Incr A
Next A
Aghab:
Do
Incr A
Set Pina.1
Set Pina.0
If A > 20 Then Goto Random
Loop
Random:
S = Rnd(10)
If S > 5 Then Goto Chap
If S < 5 Then Goto Rast
در ضمن :oops: در مورد انواع در يافت ورودي ها كه كاربردي ترند يكم توضيح بديد
البته با چندي مثال
:x
چقدر سئوال كردم........... :oops: :oops: :oops: :oops: :oops: :oops:
در ضمن دستور Adc در bascom به چه منظوري مي باشد... :roll:
فرض كنيد كه من منتظر جواب در مورد همه ي سئوال هاي بالا به خصوص سئوال زيرم

يه برنامه اي مي خوام كه اگر پايه ي b.0 برقرار بود (1) و پايه ي b.1 برقرار نبود (0) آنگاه a.0 بر قرار شود و اگر b.0 برقرار نبود و b.1 برقرار بود آنگاه a.1 برقرار شود و اگر هر دو بر قرار بودند a.0 and a.1 بر قرار شود :!:
البته خودم اين برنامه رو نوشتم ولي تو پروتس انچه كه من مي خوام نميشه :?:
آن هم به دو روش 8) اگر هم بگين اشتباهم چيه خوبه :
1)
$regfile = "8535DEF.DAT"
$crystal = 8000000
Config Porta = Output
Config Portb = Input
Dim S As Byte , S1 As Byte , S2 As Byte , S3 As Byte
S1 = Pinb.0
S2 = Pinb.1
S3 = Pinb.2
Do
If S1 = 1 And S2 = 0 And S2 = 0 Then Goto Chap
If S1 = 0 And S2 = 1 And S2 = 0 Then Goto Rast
If S1 = 1 And S2 = 1 And S2 = 0 Then Goto Aghab
If S1 = 0 And S2 = 0 And S2 = 1 Then Goto Random
If S1 = 1 And S2 = 0 And S2 = 1 Then Goto Chap
If S1 = 0 And S2 = 1 And S2 = 1 Then Goto Rast
If S1 = 1 And S2 = 1 And S2 = 1 Then Goto Aghab
Loop
End
Chap:
Set Pina.0
Reset Pina.1
Rast:
Set Pina.0
Reset Pina.1
Aghab:
Set Pina.0
Set Pina.1
Goto Random
Random:
S = Rnd(10)
If S > 5 Then Goto Chap
If S < 5 Then Goto Rast
2)
$regfile = "8535DEF.DAT"
$crystal = 8000000
Config Porta = Output
Config Portb = Input
Dim A As Byte , S As Byte
Do
A = 0
If Pinb.0 = 1 And Pinb.1 = 0 And Pinb.2 = 0 Then Goto Chap
If Pinb.0 = 0 And Pinb.1 = 1 And Pinb.2 = 0 Then Goto Rast
If Pinb.0 = 1 And Pinb.1 = 1 And Pinb.2 = 0 Then Goto Aghab
If Pinb.0 = 0 And Pinb.1 = 0 And Pinb.2 = 1 Then Goto Random
If Pinb.0 = 1 And Pinb.1 = 0 And Pinb.2 = 1 Then Goto Chap
If Pinb.0 = 0 And Pinb.1 = 1 And Pinb.2 = 1 Then Goto Rast
If Pinb.0 = 1 And Pinb.1 = 1 And Pinb.2 = 1 Then Goto Aghab
Loop
End
Chap:
For A = 0 To 20
Set Pina.0
Reset Pina.1
Incr A
Next A
Rast:
For A = 0 To 20
Set Pina.1
Reset Pina.0
Incr A
Next A
Aghab:
Do
Incr A
Set Pina.1
Set Pina.0
If A > 20 Then Goto Random
Loop
Random:
S = Rnd(10)
If S > 5 Then Goto Chap
If S < 5 Then Goto Rast
در ضمن :oops: در مورد انواع در يافت ورودي ها كه كاربردي ترند يكم توضيح بديد
البته با چندي مثال
:x
چقدر سئوال كردم........... :oops: :oops: :oops: :oops: :oops: :oops: