Button


Closed Thread
Results 1 to 6 of 6

Thread: Button

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Don't worry about your English Savnik. I understand how hard it is to explain something when English is not your native language. I'm French... but Canadian

    OK let's see one method to do that... yeah the saturday pm one solution
    Code:
            PORTB = 0
            TRISB=%10100000
            EEPROMWriteMode VAR PORTB.0
            WriteToEEPROM   var PORTB.1
            MainLed         var PORTB.2
            
            Delay var word
    
    Main:
        MainLed = 1
        if PORTB.5 = 1 THEN GOSUB P_B_sub
        goto main
        
    P_B_Sub:
        mainled = 0
        delay = 0
        while (PORTB.5 = 1) and (Delay<1000)
            pause 1     
            delay=delay+1
            wend
        if delay<1000 then return
        
        eepromwritemode=1
        delay = 0
        while (PORTB.7 = 0) and (DELAY<1000)
            pause 1
            delay=delay+1
            wend
    
        if (delay<1000) then
            writetoeeprom =1
            endif
            
        pause 1000
        eepromwritemode =0
        writetoeeprom = 0
        return
    there's still the Timer Interrupt solution...
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default

    Thank you.Your code help me to solve my problem.
    I use this code:
    Code:
       	if PORTB.5 = 1 then
            while (PORTB.5 = 1) and (Delay < 1000)
                menu = 6
                pause 1     
                delay = delay + 1
                wend
            if  delay < 1000 then
                delay = 0
                GOTO MAIN
            else
                delay = 0
                WRITE W1, TMP_LO		   
    	        WRITE W1+1, TMP_HI			
    	        LCDOUT $FE, 1, "     STORE    " 
    	        PAUSE 1000
    	        menu = 2
    	        GOTO MAIN
            endif
        endif

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Good, enjoy!

    and mmm... παρακαλώ!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Sony SIRC IR Issue
    By Ryan7777 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 8th August 2015, 08:10
  2. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43
  3. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43
  4. Button Push within 3 second Window
    By Tissy in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 22nd December 2005, 10:06
  5. Button subfunction 16F628
    By Jųan in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 19th August 2005, 16: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