Code Compatibility Issue


Results 1 to 22 of 22

Threaded View

  1. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    See the PBP manual, section 4.7...(may as well look at section 5.40 while you're at it)...

    trisa=0:trisb=2:cmcon=7:adcon1=15:adcon0=0:Off_1 var PortA.0:On_1 var PortA.1:Off_2 var PortA.2:On_2 var PortA.3:Speaker var PortA.4:Ground_1 var PortB.0:Positive_1 var PortB.1:Lame_1 var PortB.2
    Ground_2 var PortB.3:Positive_2 var PortB.4:Lame_2 var PortB.5:Switch var PortA.5:LED_1 var PortB.6:LED_2 var PortB.7:Positive_Ground_1 var bit:Ground_Lame_1 var bit:Positive_Lame_1 var bit
    Positive_Bell_1 var bit:Positive_Ground_2 var bit:Ground_Lame_2 var bit:Positive_Lame_2 var bit:Positive_Bell_2 var bit:PG1_Count var byte:PG2_Count var byte:PL1_Count var byte:PL2_Count var byte
    Cal var byte:Lockout var Word:Lockout_Cal var word:On1_Flag var bit:Off1_Flag var bit:On2_Flag var bit:Off2_Flag var bit:cal=18:lockout_cal=373:high on_1: pause 500:low on_1:high off_1: pause 500
    low off_1:high off_2: pause 500:low off_2:high on_2: pause 500:low on_2:input lame_1:INPUT LAME_2
    Foil:
    input positive_1:input positive_2:input ground_1:input ground_2:high positive_1: positive_ground_1=Ground_1: positive_lame_1=lame_2: positive_bell_1=ground_2:low positive_1:input positive_1
    input positive_2:input ground_1:input ground_2:high positive_2: positive_ground_2=ground_2: positive_lame_2=lame_1: positive_bell_2=ground_1:low positive_2:input positive_2:high ground_1
    ground_lame_1=lame_1:low ground_1:iNPUT GROUND_1:high ground_2:ground_lame_2=lame_2:low ground_2
    if positive_ground_1 = 0 and positive_bell_1 = 0 then
    pg1_count = pg1_count + 1
    else
    pg1_count = 0
    endif
    if positive_ground_2 = 0 and positive_bell_2 = 0 then
    pg2_count = pg2_count + 1
    else
    pg2_count = 0
    endif
    if positive_lame_1 = 1 AND POSITIVE_GROUND_1 = 0 then
    pl1_count = pl1_count + 1
    else
    pl1_count = 0
    endif
    if positive_lame_2 = 1 AND POSITIVE_GROUND_2 = 0 then
    pl2_count = pl2_count + 1
    else
    pl2_count = 0
    endif
    if pl1_count => cal then
    high on_1 : on1_flag = 1
    endif
    if pl2_count => caL then
    high on_2 : on2_flag = 1
    endif
    if pg1_count => cal AND PL1_COUNT < CAL then
    high off_1 : off1_flag = 1
    endif
    if pg2_count => cal AND PL2_COUNT < CAL then
    high off_2 : let off2_flag = 1
    endif
    LED_1 = GROUND_LAME_1 : LED_2 = GROUND_LAME_2
    if On1_flag = 1 or off2_flag = 1 or on2_flag = 1 or off1_flag = 1 then
    lockout = lockout + 1
    else
    lockout = 0
    endif
    if lockout => lockout_cal then
    pause 2000 : low on_1 : low on_2 : low off_1 : low off_2 : on1_flag = 0 : on2_flag = 0 : off1_flag = 0 : off2_flag = 0
    endif
    goto foil
    end
    Last edited by skimask; - 6th July 2007 at 03:59.

Similar Threads

  1. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  2. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  3. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  4. Code Issue - select case or 'if' issue - not sure why
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th October 2007, 08:52
  5. Code Issue? - Pin Labels
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 12th July 2006, 16:28

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