Beginner in need of help !!


Closed Thread
Results 1 to 40 of 72

Hybrid View

  1. #1
    Join Date
    Jan 2015
    Posts
    45


    Did you find this post helpful? Yes | No

    Default Re: Beginner in need of help !!

    Thanks a lot for the help guys, I appreciate it I understand now how isr's work now.

    Thanks,
    Rob

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default Re: Beginner in need of help !!

    Hi,
    Another aproach is to use the interrupt mechanism as a way to "latch" the buttonpress but then not actually enable the interrupt itself but instead poll the interrupt flag to determine if the button was pressed.
    Code:
    State VAR BYTE
    
    Main:
    
        If INTCON.1 = 1 THEN    ' GP2 input interrupt
          INTCON.1 = 0   ' Clear flag
          State = State + 1
          If State = 3 THEN State = 0
        ENDIF
    
       SELECT CASE State
    
          Case 0
            HIGH LED
            PAUSE 50
            LOW LED
            PAUSE 50
      
          CASE 1
            HIGH LED
            PAUSE 100
            LOW LED
            PAUSE 100
    
          CASE 2
            HIGH LED
            PAUSE 150
            LOW LED
            PAUSE 150
    GOTO MAIN

  3. #3
    Join Date
    Jan 2015
    Posts
    45


    Did you find this post helpful? Yes | No

    Default Re: Beginner in need of help !!

    Hi, I like that way as well. Although at some point I need to add a nap command with wdt off so it wakes when a voltage is higher than 0.60v & naps when voltage is less then, so I would have to use an interupt anyway at some point?

    Thanks,
    Rob

Similar Threads

  1. Beginner help!
    By Recognize in forum General
    Replies: 14
    Last Post: - 26th April 2012, 15:55
  2. pic24 beginner
    By robertpeach in forum General
    Replies: 23
    Last Post: - 13th August 2009, 12:57
  3. need help! to beginner
    By emilhs in forum mel PIC BASIC Pro
    Replies: 27
    Last Post: - 6th May 2009, 19:44
  4. Beginner at PB
    By alphahr in forum Off Topic
    Replies: 1
    Last Post: - 21st April 2008, 18:43
  5. Can anyone help a beginner in a struggle?
    By douglasjam in forum mel PIC BASIC
    Replies: 1
    Last Post: - 6th May 2005, 00:29

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