12f675_fuse_about_to_blow!


Results 1 to 40 of 929

Threaded View

  1. #27
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Henrik thanks for that.

    I'm trying to use the COUNT command that mackrackit put me onto to jump from one loop to the next after a button is pressed. There are three loops (count up to nine when button pressed once - Jump to second loop and count down from nine if button pressed a second time and to a final third loop, count down from five after button is pressed a third time).

    Is this code anywhere near to where I need to be? If I'm close but not quite there please let me carry on thinking. If I'm miles off course then a pointer would be much appreciated.

    Code:
    COUNT PIN.n, 10000, VAR B_P_C WORD  'Set GPIO.n as input, define Button Push 
    Count as VAR WORD B_P_C, with a loop count time of 10 secs.
    
    Let i = B_P_C
    
    IF B_P_C = i GOTO  FIRSTLOOP ' Button pressed once
    IF B_p_c = i+i GOTO SECONDLOOP ' Button pressed twice
    IF B_P_C = i+i+i Goto THIRDLOOP   ' Button pressed a third time
    My code tags are working today, I didn't touch anything.

    David
    Last edited by LEDave; - 2nd March 2010 at 14:58.

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