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:
Thank youCode: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
Mike




Bookmarks