Trying to inch my way to the finish line w/ a 16F1829.........


Closed Thread
Results 1 to 40 of 68

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: Trying to inch my way to the finish line w/ a 16F1829.........

    When my internet went down last night, I was forced into the manual with no outside help... it forced me to finally figure out and understand the commands to set bit in registers...YAY! But still I can't get the damn thing to work. Could ya take a look and see what's hanging me up in moving from serin/serout to hserin/hserout?


    *** Also notice, for some reason when I made the change away from HIGH/LOW, my interrupt stopped being able to "see" the status of the output pin. I had to add a variable to be set along side each time before it'd trigger the if/then's again. Seems like I wasted more memory than I saved... Is there a better fix?

    Code:
    INCLUDE "DT_INTS-14.bas"
    INCLUDE "ReEnterPBP.bas"
    
    #CONFIG
        __config _CONFIG1, _FOSC_HS & _WDTE_OFF & _PWRTE_OFF & _MCLRE_ON & _CP_OFF & _CPD_OFF & _BOREN_OFF &  _CLKOUTEN_OFF & _IESO_OFF
        __config _CONFIG2, _PLLEN_OFF & _LVP_OFF
    #ENDCONFIG
    
    DEFINE OSC 20 
    ANSELA = 0        'DISABLE ANALOG
    TRISA.1 = 1       'RX PIN AS INPUT
    ADCON1 = 7
    TXSTA.4 = 0       'SYNC BIT OFF
    RCSTA.7 = 1       'SPEN BIT ON
    RCSTA.4 = 1       'CREN BIT ON
    PIE1.5 = 1        'RCIE BIT ON
    INTCON.6 = 1      'PEIE BIT ON
    INTCON.7 = 1      'GIE BIT ON
    
    
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler    INT_INT,  _doEncoder,    PBP,  yes
        endm
        INT_CREATE            ; Creates the interrupt processor
    ENDASM
    @   INT_ENABLE   INT_INT
    
    
    avg var word
    UP var PORTC.0
    TRISC.0 = 0
    UP = 0
    DOWN var PORTC.1
    TRISC.1 = 0
    DOWN = 0
    WEST var PORTC.2
    TRISC.2 = 0
    WEST = 0
    EAST var PORTC.7
    TRISC.7 = 0
    EAST = 0
    RX var PORTC.5
    TRISB.6 = 1
    TX var PORTC.4
    TRISB.5 = 0
    azLIMIT var PORTC.6
    TRISC.6 = 1
    LED var PORTB.7
    TRISB.7 = 0
    LED = 1
    newpos var word
    oldpos var word
    distance var word
    Eencoder0Pos var word
    Aencoder0Pos var word
    Enewposition var word
    Eoldposition var word
    elHOMEpos var word
    elSTOWpos var word
    Anewposition var word
    Aoldposition var word
    azPOS var word
    azSTOWpos var word
    azHOMEpos var word
    cereal var word
    apple var word
    apple = 0
    stowed var word
    stowed = 0
    wsave var byte $70 SYSTEM
    wsave1 var byte $A0 SYSTEM
    wsave2 VAR BYTE $120 SYSTEM
    wsave3 VAR BYTE $1A0 SYSTEM
    HEL var byte
    HAZ var byte
    b0 var byte
    i var byte
    el_UP var byte
    el_UP = 0
    el_DN var byte
    el_DN = 0
    az_EAST var byte
    az_EAST = 0
    az_WEST var byte
    az_WEST = 0
    
    goto MainMenu
    
    disable
    doEncoder:
        if el_UP = 1 then Eencoder0Pos = Eencoder0Pos + 1
        iF el_DN = 1 THEN Eencoder0Pos = Eencoder0Pos - 1
        IF az_WEST = 1 THEN Aencoder0Pos = Aencoder0Pos + 1
        IF az_EAST = 1 THEN Aencoder0Pos = Aencoder0Pos - 1
    @ INT_RETURN
    
    allSTOP:
    GOSUB POS
    WEST = 0
    EAST = 0
    UP = 0
    DOWN = 0
    el_UP = 0
    el_DN = 0
    az_EAST = 0
    az_WEST = 0
    pause 2000
    return
    
    
    CLR:
        For i = 0 to 30
            hserout [10]
        next i
    return
    
    
    TEST1:
    Eencoder0Pos = 0
    avg = 0
    testloop:
    gosub POS
    el_UP = 1
    UP = 1
    for i = 1 to 30
    pause 250
    oldpos = newpos
    newpos = Eencoder0POS
    if oldpos > newpos then distance = oldpos - newpos
    if newpos > oldpos then distance = newpos - oldpos
    avg = avg + distance
    hserout  ["Distance Travelled: ", #distance, 13, 10]
    next i
    gosub allSTOP
    avg = avg/30
    pause 1500
    hserout  ["Test Complete. 1/4 Second Average was: ", #avg, 13, 10]
    pause 5000
    goto MainMenu
     
              
    
    
    
    Startup:
        pause 2000
        gosub CLR
        hserout  ["Running Startup Procedures!", 13, 10]
        hserout ["PLEASE WAIT....", 13, 10]
        pause 3000
        Eencoder0Pos = 0
        hserout  [10, 10, "Eencoder0Pos Before is: ", #Eencoder0Pos, 13, 10]
    	pause 2000
        Eoldposition = Eencoder0Pos
    	DOWN = 1
    	el_DN = 1
        pause 1000
    	gosub allSTOP
        hserout  [10, "Eencoder0Pos After is: ", #Eencoder0Pos, 13, 10]
    	pause 2000
        Enewposition = Eencoder0Pos
        hserout  [10, "Eoldposition is: ", #Eoldposition, 13, 10]
        hserout  [10, "Enewposition is: ", #Enewposition, 13, 10]
        pause 2000
        IF Eoldposition = Enewposition THEN
    		stowed = 1
    		apple = 1
    		pause 5000
            gosub CLR
    		hserout  ["Startup Sequence Good!", 13, 10]
    		hserout  ["Continuing to Main Menu...", 13, 10]
            pause 3500
            goto MainMenu
    	ENDIF
    	IF Enewposition <> Eoldposition THEN
    		stowed = 0
    		apple = 0
    		UP = 1
    		el_UP = 1
            pause 1000
    		gosub allSTOP
    		gosub CLR
    		hserout  ["Startup Error!", 13, 10]
    		hserout  ["Dish will need homing before move will be allowed!", 13, 10]
            hserout  ["Continuing to Main Menu...", 13, 10]
            pause 5000
            goto Mainmenu
        ENDIF
    
    MainMenu:
        gosub CLR
        hserout  ["******** MAIN MENU ********", 13, 10, 10]
        hserout  [" 1. Start Homing Sequence", 13, 10]
        hserout  [" 2. Manual JOG Mode", 13, 10]
        hserout  [" 3. Auto-Acquire Satellite", 13, 10]
        hserout  [" 4. Stow Dish for Travel", 13, 10, 10]
        hserout  ["Enter Your Selection:"]
        hserin [b0]
        If b0 = "1" then goto HomeDish 
        If b0 = "2" then goto JogMenu
        If b0 = "3" then goto TEST1
        If b0 = "4" then goto Startup
    goto MainMenu
    
    HomeDish:
        gosub CLR
        hserout ["******** HOME DISH ********", 13, 10, 10]
        hserout [" 1. Start Homing Sequence", 13, 10, 10]
        hserout [" 2 Abort Homing", 13, 10, 10]
        hserout ["Enter Your Selection:"]
        hserin [b0]
        if b0 = "2" then goto MainMenu
        homeloop:
        IF b0 = "1" THEN 
            gosub HomeEL
            'gosub HomeAZ
            HAZ = 1
            IF (HEL = 1) AND (HAZ = 1) THEN
                gosub clr
                hserout ["HOME PROCESS WAS SUCCESSFUL!", 13, 10]
                goto MainMenu
            ENDIF
            IF (HEL = 0) OR (HAZ = 0 ) THEN
                gosub clr
                hserout  ["DIS HOME PROCESS CAN SUCK MY DICK!", 13, 10]
                goto MainMenu
            ENDIF
        ENDIF
        pause(200)
        goto homeloop
    goto HomeDish
    
    HomeAZ:
        gosub clr
        hserout  ["HOMING AZIMUTH - PLEASE WAIT..", 13, 10]
        PAUSE(500)
        Aencoder0Pos = 0
        oldpos = 0
        WEST = 1
        az_WEST = 1
        PAUSE(250)
        IF Aencoder0Pos = 0 THEN
            gosub allSTOP
            EAST = 1
            az_EAST = 1
            PAUSE(250)
            gosub allSTOP
            PAUSE(500)
            Aencoder0Pos = 0
            WEST = 1
            az_WEST = 1
            PAUSE(500)
            IF Aencoder0Pos = 0 THEN goto moveerror
        ENDIF
        pause 1000
        loop4:
        pause 250
        oldpos = newpos
        newpos = Aencoder0POS
        if oldpos > newpos then distance = oldpos - newpos
        if newpos > oldpos then distance = newpos - oldpos
        if distance < 100 then
            gosub allSTOP
            Aencoder0Pos = 65000
            hserout  ["HOMING AZIMUTH WAS SUCCESSFUL!", 13, 10]
            HAZ = 1
        endif
        goto loop4
        az_EAST = 1
        EAST = 1
        loop8:
        pause 100
        if Aencoder0Pos > 0 then goto loop8
        return
      
    
    HomeEL:
    gosub clr
    hserout  ["HOMING ELEVATION - PLEASE WAIT..", 13, 10]
    PAUSE(500)
    Eencoder0Pos = 0
    el_UP = 1
    UP = 1
    PAUSE(250)
    IF Eencoder0Pos = 0 THEN
        gosub allSTOP
        DOWN = 1
        el_DN = 1
        PAUSE(250)
        gosub allSTOP
        PAUSE(500)
        Eencoder0Pos = 0
        UP = 1
        el_UP = 1
        PAUSE(500)
        IF Eencoder0Pos = 0 THEN goto moveerror
    ENDIF
        pause 1000
        oldpos = Eencoder0Pos
        loop3:
        pause 250
        newpos = Eencoder0POS
        hserout  ["oldpos = ", #oldpos, 13, 10]
        hserout  ["newpos = ", #newpos, 13, 10]
        if oldpos > newpos then distance = oldpos - newpos
        if newpos > oldpos then distance = newpos - oldpos
        if oldpos = newpos then distance = 0
        hserout  ["distance = ", #distance, 13, 10]
        oldpos = newpos
        if distance < 1 then
            gosub allSTOP
            Eencoder0Pos = 3000
            HAZ = 1
        hserout  ["HOMING ELEVATION WAS SUCCESSFUL!", 13, 10]
        goto safe_el
        endif
        goto loop3
        safe_el:
        el_DN = 1
        DOWN = 1
        loop9:
        pause 100
        gosub pos
        if Eencoder0Pos > 1500 then goto loop9
        return
      
    JogMenu:
    gosub CLR
    pause 250
    hserout  ["***** JOG MENU *****", 13, 10, 10]
    hserout  ["U - UP", 13, 10]
    hserout  ["D - DOWN", 13, 10]
    hserout  ["E - EAST", 13, 10]
    hserout  ["W - WEST", 13, 10]
    hserout  ["S - ALL STOP", 13, 10]
    hSEROUT  ["X - MAIN MENU", 13, 10, 10]
    hserin [b0]
    if b0 = "U" Then
        gosub allSTOP
        HIGH UP
        el_UP = 1
    endif
    if b0 = "D" then
        gosub allSTOP
        HIGH DOWN
        el_DN = 1
    endif
    if b0 = "E" then
        gosub allSTOP
        high EAST
        az_EAST = 1
    endif
    if b0 = "W" then
        gosub allSTOP
        HIGH WEST
        az_WEST = 1
    endif
    if b0 = "S" then gosub allSTOP
    if b0 = "X" then 
        gosub allSTOP
        goto MainMenu
    endif
    goto JOGMenu
    
    ACQUIRE:
    goto MainMenu
    
    STOW:
    goto MainMenu
    
    
    
    abort:
    gosub allSTOP
    gosub clr
    hserout  ["USER STOP! -- MOVE ABORTED!", 13, 10]
    PAUSE(5000)
    goto MainMenu
    
    moveerror:
    gosub allSTOP
    gosub clr
    hserout  ["SYSTEM ERROR! -- MOVE ABORTED!", 13, 10]
    PAUSE(5000)
    goto MainMenu
    
    POS:
    pause 100
    hserout  ["  EL -- ", #Eencoder0Pos, "  AZ -- ", #Aencoder0Pos, 13, 10]
    return
    Last edited by thasatelliteguy; - 5th June 2014 at 15:51. Reason: oops on the code tags

  2. #2
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: Trying to inch my way to the finish line w/ a 16F1829.........

    To set up Hserin/Hserout use defines here is what the manual says.


    The serial parameters and baud rate are specified using DEFINEs:
    ' Set receive register to receiver enabled
    DEFINE HSER_RCSTA 90h
    ' Set transmit register to transmitter enabled
    DEFINE HSER_TXSTA 20h
    ' Set baud rate
    DEFINE HSER_BAUD 2400
    ' Set SPBRG, SPBRGH directly
    ' (better to set HSER_BAUD instead)
    DEFINE HSER_SPBRG 25
    DEFINE HSER_SPBRGH 0

    This is the way I use it but I know there are always alternatives.

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Trying to inch my way to the finish line w/ a 16F1829.........

    http://www.picbasic.co.uk/forum/showthread.php?t=4994

    Mistet E's Multicalc utility, just what you need for USART.

    Robert

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default Re: Trying to inch my way to the finish line w/ a 16F1829.........

    Hi,
    The 16F1829 has analog inputs on PortA, PortB and PortC but you're only disabling it on PortA. You absolutely MUST read the datasheet for these things. A pin in analog mode may seem to work when used as an output (but it will eventually bite you (RMW issue etc)), however when you're trying to read the state of that output pin (which is what you're doing (or originally did) in the ISR it will not give you the correct result. This is also clearly stated in the datasheet:
    Setting the appropriate ANSELA bit high will cause all
    digital reads on the pin to be read as ‘0’ and allow
    analog functions on the pin to operate correctly
    And the same thing applies for ANSELB and C of course. As you can see, if the ANSELx register isn't set correct any READ of that port-pin will return 0.

    Also, I don't see you're using the ADC for anything yet you're setting ADCON1=7, why is that?

    /Henrik.

  5. #5
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Trying to inch my way to the finish line w/ a 16F1829.........

    http://www.picbasic.co.uk/forum/showthread.php?t=18529

    If you want to see what you need to make pins digital.

    Robert

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: Trying to inch my way to the finish line w/ a 16F1829.........

    Quote Originally Posted by HenrikOlsson View Post
    Hi,
    The 16F1829 has analog inputs on PortA, PortB and PortC but you're only disabling it on PortA. You absolutely MUST read the datasheet for these things. A pin in analog mode may seem to work when used as an output (but it will eventually bite you (RMW issue etc)), however when you're trying to read the state of that output pin (which is what you're doing (or originally did) in the ISR it will not give you the correct result. This is also clearly stated in the datasheet:
    And the same thing applies for ANSELB and C of course. As you can see, if the ANSELx register isn't set correct any READ of that port-pin will return 0.
    /Henrik.
    Ok sensei, but if that's the case, why did it work fine before? Does high/low set the pin to digital as well as setting the tris bit? Or just a fluke. When it comes to computers, I don't really put much stock in 'accidents' except in the context of "I accidentally screwed that up" lol

    Quote Originally Posted by HenrikOlsson View Post
    Also, I don't see you're using the ADC for anything yet you're setting ADCON1=7, why is that?
    /Henrik.
    I am not sure why it's there. This code started out on a 877a then went to something else when I smoked all 5 of those. Then back to 877a when more came in, then to this 1829 when I smoked all the new 877a's. This 1829 is actually the PICAXE20M2 that got me started on PIC vs Arduino. I came up on two of them scrapping something and saved them. Later, while going thru stuff, I realized they were MC's, and then what PICAXE was, and here I am..... But the code has been cut and pasted, and gone from MPLABX to MCS so idk....

  7. #7
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: Trying to inch my way to the finish line w/ a 16F1829.........

    Quote Originally Posted by thasatelliteguy View Post
    This code started out on a 877a then went to something else when I smoked all 5 of those. Then back to 877a when more came in, then to this 1829 when I smoked all the new 877a's. This 1829 is actually the PICAXE20M2 that got me started on PIC vs Arduino. I came up on two of them scrapping something and saved them. Later, while going thru stuff, I realized they were MC's, and then what PICAXE was, and here I am..... But the code has been cut and pasted, and gone from MPLABX to MCS so idk....
    I wasted many an unhappy day copying and pasting code that did not work.

    I would start again and build up the program one step at a time. By adding small portions of code if the code stops working the small modification is the cause.

    A good place to start is with the main menu, simply to test HSEROUT and HSERIN. Then take another very small step.

  8. #8
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default Re: Trying to inch my way to the finish line w/ a 16F1829.........

    Hi,
    Ok sensei, but if that's the case, why did it work fine before? Does high/low set the pin to digital as well as setting the tris bit?
    No, HIGH/LOW only handles the TRIS bit. I'm surprised, and a bit sceptical to be honest, that it really did work before. Then, of course, there might be something I'm missing - wouldn't be the first time, for sure.

    When moving from one PIC to another you really do need to verify that what you set the registers to applies to the new chip as well. Usually it does but certainly not always - especially if you move from one series to another. CMCON is one example, someone searches the forum, finds a post where it says that CMCON=7 disables the comparators. This is true for the some PICs but not all.... It's tedious (some might even say boring) but reading the datasheet really is a must and you certainly do learn a lot from doing it.

    /Henrik.

  9. #9
    Join Date
    May 2013
    Location
    australia
    Posts
    2,663


    Did you find this post helpful? Yes | No

    Default Re: Trying to inch my way to the finish line w/ a 16F1829.........

    bit 7 of your config word should be 0 , having lvp enabled can lead to tears .
    the comparator needs to be disabled to use your porta pins as digital
    Last edited by richard; - 29th June 2014 at 05:44. Reason: typo

  10. #10


    Did you find this post helpful? Yes | No

    Default Re: Trying to inch my way to the finish line w/ a 16F1829.........

    So you have your BT sorted out?

    I use a BT chip on my boards with no converter. I have the BT chip running at 3.3v just like the PIC.

    I am not sure what you are meaning by handheld device but if you are using a BT chip, look into making the app work on your Android phone.

    Look into Basic4Android. Its a piece of cake to use. The wireless side is a bit cumbersome but once you get it going, its pretty slick. I use it to make an app to control up to 48 electrical motors sending data back and forth from the motor control boards to a tablet all wirelessly.

    http://www.basic4ppc.com/index.html

    If you get try it and need some help, email me at [email protected]

  11. #11


    Did you find this post helpful? Yes | No

    Default Re: Trying to inch my way to the finish line w/ a 16F1829.........

    Quote Originally Posted by richard View Post
    bit 7 of your config word should be 0 , having lvp enabled can lead to tears .
    the comparator needs to be disabled to use your porta pins as digital
    A thousand thank-yous my friend! It worked beautifully!

  12. #12
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Trying to inch my way to the finish line w/ a 16F1829.........

    Quote Originally Posted by thasatelliteguy View Post
    Well in this case I did that... It's just that it seems when trying to enable the hardware serial, there is A LOT of stuff to activate/set, and I just wasn't getting the combination correct. Still haven't... but haven't tried today either. I got sidetracked on another project... Gotta start a thread on that one now.
    Like I said, check this out. Tell it what you want and it gives you the settings.

    Quote Originally Posted by Demon View Post
    http://www.picbasic.co.uk/forum/showthread.php?t=4994

    Mistet E's Multicalc utility, just what you need for USART.

    Robert
    Robert

  13. #13


    Did you find this post helpful? Yes | No

    Default Re: Trying to inch my way to the finish line w/ a 16F1829.........

    OK! I think I have my permanent solution. Since I had no problems with the first setup I did with this project where I was using physically attached buttons instead of serial commands to control the unit, I am adding a second PIC, whose only job in life is to sit at a serin command pause and await commands. Upon receiving a command, it will simply set a pin high for about 100ms, simulating a button press. Proof of concept already works... Just have two small snags... (and a large one too, but one step at a time lol)
    1. I am trying to send via serial just one character. Capital A-F, depending on what combo of buttons is pressed by the user. It's not going thru. The BT is linked. The link seems good. When I hold a button down, it causes the serin pause to release, causing my debugging LED to flash. However, no command is processed. I'm sure it's a format problem or something, but I have tried 9 ways to sunday and I just can't seem to spot what I'm doing wrong. Also, if I shut down the master BT and log my laptop terminal into the dish PIC, sending A-F from the terminal works perfectly and it responds as expected.

    2. Only buttons 3 and 4 work. Buttons 1 and 2 do not cause the LED to flash on the receiving end. I assume I'm missing something again about analog/digital, but this pic is very basic and has no ADC, and for the life of me I cannot figure out what I am missing. I have read thru every register in the datasheet, and I'm just not snapping to what it is...

    Here is the code for the handheld device:
    Code:
    '****************************************************************
    '*  Name    : Wireless Handheld Device                                            
    '*  Author  : John Moore                                           
    '*  CHIP    : PIC16F628A                               
    '*  Date    : May 28, 2014                                           
    '*  Version : 1.0                                               
    '*  Notes   : This pic will eventually have 4 physical buttons and an LCD                                        
    '*          : as well as a BT device. Right now I just need it to send the
    '*          ; serial commands, as I am monitoring the feedback with a terminal.                                                  
    '****************************************************************
    #CONFIG
    __config 10000111110000
    #ENDCONFIG
    
    button1 var PORTA.2
    button2 var PORTA.3
    button3 var PORTA.4
    button4 var PORTB.3
    TRISA.2 = 1
    TRISA.3 = 1
    TRISA.4 = 1
    TRISB.3 = 1
    cereal var byte
    TX var PORTB.2
    TRISB.2 = 0
    START:
    if button1 = 1 then cereal = "A"
    if button2 = 1 then cereal = "B"
    if button3 = 1 then cereal = "C"
    if button4 = 1 then cereal = "D"
    if (button2 = 1) and (button3 = 1) then cereal = "E"
    if (button1 = 1) and (button4 = 1) then cereal = "F"
    if cereal <> "X" then serout TX, 2, [cereal]
    pause 100
    cereal = "X"
    GOTO START
    Here is the code for the PIC16F628A that is receiving the commands and "pressing buttons":
    Code:
    '****************************************************************
    '*  Name    : On-Board Communication PIC                                            
    '*  Author  : John Moore                                           
    '*  CHIP    : PIC16F628A                               
    '*  Date    : May 28, 2014                                           
    '*  Version : 1.0                                               
    '*  Notes   : This pic will never be more complicated than this. It's only                                     
    '*          : purpose in life is to get characters and push buttons.                                                  
    '****************************************************************
    #CONFIG
    __config 10000111110000
    #ENDCONFIG
    
    button1 var PORTB.7
    button2 var PORTB.6
    button3 var PORTB.5
    button4 var PORTB.4
    TRISB.7 = 0
    TRISB.6 = 0
    TRISB.5 = 0
    TRISB.4 = 0
    button1 = 0
    button2 = 0
    button3 = 0
    button4 = 0
    
    RX var PORTB.3
    TRISB.3 = 1
    LED var PORTA.1
    TRISA.1 = 0
    
    cereal var byte
    
    START:
    serin RX, 2, cereal
    if cereal = "A" then 
        high button1
        pause 140
        low button1
    endif
    
    if cereal = "B" then 
        high button2
        pause 140
        low button2
    endif
    
    if cereal = "C" then 
        high button3
        pause 140
        low button3
    endif
    
    if cereal = "D" then 
        high button4
        pause 140
        low button4
    endif
    
    if cereal = "E" then 
        button2 = 1
        button3 = 1
        pause 140
        button2 = 0
        button3 = 0
    endif
    
    if cereal = "F" then 
        button1 = 1
        button4 = 1
        pause 140
        button1 = 0
        button4 = 0
    endif
    LED = 1
    pause 250
    LED = 0
    pause 250
    GOTO START

Similar Threads

  1. Replies: 2
    Last Post: - 31st May 2013, 18:19
  2. line truncate...again
    By queenidog in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 12th March 2012, 21:58
  3. Most Users Ever On-Line
    By skimask in forum Off Topic
    Replies: 1
    Last Post: - 26th April 2007, 19:06
  4. 2 Line Chars on a 2 Line LCD
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 16th November 2003, 00:44

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