Multi-Button CSM with Pic16LF722A


Results 1 to 32 of 32

Threaded View

  1. #17
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: Multi-Button CSM with Pic16LF722A

    since the isr TB1 is an accurate timebase you can
    make a new var
    Code:
     kio_inhibit var byte
    modify the I/o key routine
    Code:
    IF KP = 0 THEN '1/0 BUTTON PRESSED
            ;use  p_level to see what state machine is in  0=off ,non zero = on
            if kio_inhibit==0 then
               kio_inhibit=152    ;152*32mS = about 5 seconds
            if  p_level then     
                ccp1con=0 ;must be on kill it
                led=0
                p_level= 0
            else         ;must be off  power to max
                p_level= 5
            endif
           endif
    and add this to the isr

    Code:
    if kio_inhibit then
        kio_inhibit =  kio_inhibit -1
        endif
    now the I/O key is inhibited for 5 sec after being acted on

    I like ART's quote and its so true
    PBP is very well documented, however you’ll notice all examples of command use are also examples of exactly how not to write a cyclic program.
    you need to adjust your way of thinking to loops , states and flags . it opens up a whole new vista
    Last edited by richard; - 25th May 2016 at 08:26.
    Warning I'm not a teacher

Similar Threads

  1. Replies: 5
    Last Post: - 18th March 2012, 21:40
  2. multi functions button press
    By malwww in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th May 2009, 00:12
  3. Multi-Threading
    By Ted's in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 2nd September 2008, 05:55
  4. Multi-tasking
    By malc-c in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 13th July 2006, 18:50
  5. Multi Interrupt How To ?
    By capitano in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd February 2005, 14:48

Members who have read this thread : 3

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