NOTICE توجه: این یک موضوع قدیمی است که آخرین پست ارسالی آن مربوط به 4051 روز قبل است . لطفا فقط پاسخ ها ، سوالات و درخواست های 100 درصد مرتبط را به آن ارسال کنید و برای درخواست ها و سوالات جدید موضوع جدیدی را ایجاد کنید
نمایش نتایج: از 1 به 1 از 1

موضوع: برنامه گیرنده و فرستنده hmt ,r

  1. #1
    تازه وارد
    تاریخ عضویت
    Apr 2013
    نوشته ها
    1
    تشکر
    0
    تشکر شده 1 بار در 1 پست

    Icon16 برنامه گیرنده و فرستنده hmt ,r

    سلام
    من برنامه زیر را ب ای گیرنده و فرستنده نوشتم(البته با کمک این سایت)
    در عمل درست کار نمیکند
    ولی زمانی که یک ال ای دی در پایه ارسال مگذارم چشمک میزند
    برنامه فرستنده
    $regfile = "m8def.dat"
    $crystal = 11059200
    $baud = 9600
    Config Pinc.0 = Input
    Config Portb.0 = Output
    Config Pinc.1 = Input
    Config Portb.1 = Output
    Config Pinc.2 = Input
    Config Portb.2 = Output
    Config Pinc.3 = Input
    Config Portb.3 = Output
    Config Pinc.4 = Input
    Config Portb.4 = Output
    Dim X As String * 13
    Dim A As String * 13
    Dim B As String * 13
    Dim C As String * 13
    Dim D As String * 13
    Dim E As String * 13
    Dim F As String * 13
    Dim G As String * 13
    Dim H As String * 13
    Dim I As String * 13
    Dim J As String * 13
    A = "chnal1"
    B = "kh1"
    C = "chanal2"
    D = "kh2"
    E = "chanal3"
    F = "kh3"
    G = "chanal4"
    H = "kh4"
    I = "thigh"
    J = "kh5"
    Do
    Main:
    Debounce Pinc.0 , 1 , K1
    W:
    Debounce Pinc.0 , 0 , K11
    M:
    Debounce Pinc.1 , 1 , K2
    Q:
    Debounce Pinc.1 , 0 , K21
    N:
    Debounce Pinc.2 , 1 , K3
    Z:
    Debounce Pinc.2 , 0 , K31
    P:
    Debounce Pinc.3 , 1 , K4
    T:
    Debounce Pinc.3 , 0 , K41
    O:
    Debounce Pinc.4 , 1 , Thigh
    Ui:
    Debounce Pinc.4 , 0 , Thigh1

    Loop
    'xxxxxxxxxxxxxxxxxxxxxxxxxxx
    K1:
    Do
    Set Portb.0
    Print A ; Chr(13);
    Loop Until Pinc.0 > 1
    Goto W

    K11:
    Reset Portb.0
    Print B ; Chr(13);
    Goto M
    'xxxxxxxxxxxxxxxxxxxxxxxxxxx
    K2:
    Do
    Set Portb.1
    Print C ; Chr(13);
    Loop Until Pinc.1 > 1
    Goto Q

    K21:
    Reset Portb.1
    Print D ; Chr(13);
    Goto N
    'xxxxxxxxxxxxxxxxxxxxxxxxxxx
    K3:
    Do
    Set Portb.2
    Print E ; Chr(13);
    Loop Until Pinc.2 > 1
    Goto Z

    K31:
    Reset Portb.2
    Print F ; Chr(13);
    Goto P
    'xxxxxxxxxxxxxxxxxxxxxxxxxxxx
    K4:
    Do
    Set Portb.3
    Print G ; Chr(13);
    Loop Until Pinc.3 > 1
    Goto T

    K41:
    Reset Portb.3
    Print H ; Chr(13);
    Goto O
    'xxxxxxxxxxxxxxxxxxxxxxxxxxxx
    Thigh:
    Set Portb.4
    Print I ; Chr(13);
    Goto Ui

    Thigh1:
    Reset Portb.4
    Print J ; Chr(13);
    Goto Main
    برنامه گیرنده

    $regfile = "m8def.dat"
    $crystal = 11059200
    $baud = 9600
    Config Portb.4 = Output : B4 Alias Pinb.4
    Config Portb.1 = Output : B1 Alias Pinb.1
    Config Portb.2 = Output : B2 Alias Pinb.2
    Config Portb.3 = Output : B3 Alias Pinb.3
    Config Portb.5 = Output
    Reset Portb.0
    Reset Portb.1
    Reset Portb.2
    Reset Portb.3
    Reset Portb.4
    Reset Portb.5

    Dim X As String * 13
    Dim A As Word

    Do
    Input X
    'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    If X = "chnal1" Then
    Do
    Set Portb.4
    Input X
    Loop Until X <> "chnal1"
    End If

    If X = "kh1" Then
    Reset Portb.4
    End If

    'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    If X = "chanal2" Then
    Do
    Set Portb.1
    Input X
    Loop Until X <> "chanal2"
    End If

    If X = "kh2" Then
    Reset Portb.1
    End If

    'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    If X = "chanal3" Then
    Do
    Set Portb.2
    Input X
    Loop Until X <> "chanal3"
    End If

    If X = "kh3" Then
    Reset Portb.2
    End If

    'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    If X = "chanal4" Then
    Do
    Set Portb.3
    Input X
    Loop Until X <> "chanal4"
    End If

    If X = "kh4" Then
    Reset Portb.3
    End If

    'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    If X = "thigh" Then
    Set Portb.5
    End If

    If X = "kh5" Then
    Reset Portb.5
    End If
    'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    Loop


  2. تشکرها از این نوشته :


  3. # ADS
    Circuit advertisement
    تاریخ عضویت
    Always
    نوشته ها
    Many
     

موضوعات مشابه

  1. پاسخ: 3
    آخرين نوشته: 24-03-2013, 18:38

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •