Quote Originally Posted by cncmachineguy View Post
Hank, I think the hangup for you is how you generate the pattern.

If you use some counters to "decide" when and what led to light up, instead of hanging your program for .4 seconds, you will see the flag check much faster.

Maybe have your interrupt be a time base, like .1mS or something. Then while in the ISR, check for button press and inc your "led counters"

I know this is vague, but all I have time for right now.
Hi Bert,

You're bang on ...using pauses is not optimum, as obviously while it's erhm pausing it ain't doing anything else.

the problem here is I'm already using two timers in my same testbed program here (one for a special event trigger & another to control HPWM) ...ok, so I've 3 timers left (16f1824 has 5 timers) , but I need a whole heap of different pauses (& some quite longish...I've always had an epic fail when I've tried to use timers for long pauses!) ....now I realise I could just reset the timer preload value accordingly each time I need a different pause, but ....aaargh ....brainache. I guess that's what it comes down to... a solution that avoids brainache ...it's a fair cop, I'll get me coat!


Henrik,

Many thanks for the comprehensive examples...I shall study them later tonight.

Cheers,
Hank