Delayed output 10 secs


Results 1 to 38 of 38

Threaded View

  1. #1
    Join Date
    May 2009
    Location
    Montreal, QC, Canada
    Posts
    118

    Default Delayed output 10 secs

    Hi,

    I am relatively new at this and I need a little help.
    I am using a 16F883
    Portb with pull ups as input, portc as instantaneous output and porta as delayed output.
    When I press switch 1 (low), it will toggle portc.1 (on)
    if I maintain switch 1 (low) for 3 seconds it will branch to another section.
    if I press switch 1 again it will toggle portc.1 (off)
    So far so good, my program is working fine but I want to add porta.1 which will trigger approx 10 seconds after portc.1

    Keeping in mind that the explaination above is for 1 switch / 1 output portc / 1 output porta but it will endup having 6 of each.

    Here is my code:

    Code:
    start:
        if sw1 = 0 then Bdelay1
    goto start
    
    Bdelay1:
        pause 25                                  ; debounce
        if sw1 = 0 then
            if ld1 = 0 or swstat = 1 then
                high ld1
                pause 500
                swstat = 1
                l=l+1
                if l => 5 then Bprog1
                goto bdelay1
            else
                 low ld1
                 pause 500
    wait1:     if sw1 = 0 then wait1
            endif
        endif
        swstat = 0   
        goto start
    Thank you

    Mike
    Last edited by lilimike; - 28th May 2009 at 03:24.

Similar Threads

  1. How to drive the Vinculum VDIP1 in UART mode
    By BrianT in forum Code Examples
    Replies: 41
    Last Post: - 23rd May 2013, 12:34
  2. USB-FTDI[UM232R] with PIC16f877a
    By bjox in forum USB
    Replies: 1
    Last Post: - 23rd February 2008, 22:40
  3. Serious Serial Situation Setbacks...
    By Dansdog in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th February 2007, 03:46
  4. Serial Output 10 Bits
    By GEEZER in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 17th May 2005, 02:14
  5. Using 4 input to control 10 output
    By cibotsan in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 5th November 2004, 12:08

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