Pic16f84 and RC5 kode


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest

    Default

    DEFINE OSC 8
    INCLUDE "MODEDEFS.BAS"
    a1 var word : b0 var byte : trisa=3 : trisb=0 : low portb : pause 500
    Start: IF PORTA.0 = 1 THEN START
    PAUSEUS 100 : IF PORTA.0 = 1 THEN START
    PAUSEUS 1350 : A1.0[13] = PORTA.0
    for b0 = 12 to 0 step -1 : a1.0[b0]=porta.0 : pauseus 1700 : next b0
    if a1.lowbyte = $FF THEN START
    A1 = ~A1 & $003F
    IF PORTA.1 = 1 THEN
    if a1 > 0 and a1 < 9 then
    toggle portb.0[a1-8] : pause 500 : goto start
    else
    if a1=9 then
    toggle porta.2 : pause 500 : goto start
    else
    if a1=10 then
    toggle porta.3 : pause 500 : goto start
    else
    if a1=11 then
    portb=$ff : porta.2=1 : porta.3=1 : pause 500 : goto start
    else
    if a1=12 then
    portb=0 : porta.2=0 : porta.3=0 : pause 500 : goto start
    endif
    endif
    endif
    endif
    endif
    ELSE
    if a1>0 and a1<9 then
    high portb.0[a1-8] : pause 500 : low portb.0[a1-8]:goto start
    else
    if a1=9 then
    high porta.2 : pause 500 : low porta.2 : goto start
    else
    if a1=10 then
    high porta.3 : pause 500 : low porta.3 : goto start
    else
    if a1=11 then
    portb=$ff : porta.2=1 : porta.3=1 : pause 500 : portb.=0 : porta.2=0 : porta.3=0 : goto start
    endif
    endif
    endif
    endif
    ENDIF
    PAUSE 250 : GOTO START
    END

  2. #2
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    89

    Default

    Hi skimask,

    Thanks to redused code.

  3. #3
    Join Date
    Jun 2007
    Posts
    2

    Default

    Thank you

    I Maaked detektor with ic 555 like generator ic signals and any Pic in reciver module (16f84).
    If stop signal then rele in NC kontakt have horn.
    this program is first tray, workin bat having too many problems.

    'on of if any tast. in the tv remote kontrol push down.
    'TSOP 1736 data in pin A.2


    rele var PortB.6
    id var byte

    TRISA.2=1
    id=0

    Pocetak:

    low led
    pulsin PortA.2,0,id
    if id >100 then ukljuci
    goto pocetak

    ukljuci:

    high rele
    goto pocetak

    end

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts