still stuck!please help!microcode studio +!16f84a!

Discussion in 'Programmer's Corner' started by programmer1, Mar 26, 2009.

  1. programmer1

    Thread Starter New Member

    Mar 15, 2009
    3
    0
    i have the following code working on a 16f84a.
    my problem is that i need to have a time variable to tell me how long the switch has been pressed for and to store the value. im using microcode studio plus.
    ive looked through the studio plus manual and the help in studio plus and it just doesnt make sense to me.

    if i could get some direction in this i would be forever in your debt as ive very little time left on this.

    the open label at the end is for a barrier which ive yet to write code for.

    im not sure what else i need to put up here as my last post didnt attract any helpers so please tell me if more info is required.

    Add-on---ive had no feedback from this so im going to try somewhere else but thanks for those that looked.


    symbol CAR=PORTB.1
    SYMBOL TRUCK=PORTB.2
    SYMBOL CAPACITY = 5
    SYMBOL CAPACITY2 = 5
    I var byte
    temp var byte
    CNTCAR var word
    CNTTRUCK VAR WORD
    TRISB=3
    CNTCAR=0
    CNTTRUCK=0

    Lcdout $fe, 1 ' Clear LCD screen
    Lcdout "project" ' Display Hello
    Pause 5000 ' Wait 5 second
    Lcdout $fe, 1 ' Clear LCD screen
    Lcdout "yes"
    Pause 5000 ' Wait 5 second

    LOOP:
    TEMP=0
    BUTTON TRUCK,1,255,0,TEMP,0,LCD
    TEMP=0
    BUTTON CAR,1,255,0,TEMP,0,LCD1
    GOTO LOOP

    end

    LCD:
    Lcdout $fe, 1 ' Clear LCD screen
    Lcdout "TRUCK ENTERING"
    Pause 5000 ' Wait 5 second
    Lcdout $fe, 1 ' Clear LCD screen

    LCD1:
    Lcdout $fe, 1 ' Clear LCD screen
    Lcdout "CAR ENTERING"
    Pause 5000 ' Wait 5 second
    Lcdout $fe, 1 ' Clear LCD screen

    OPEN:
    GOTO loop
     
    Last edited: Mar 27, 2009
Loading...