Again - I don't know what else your PIC must do at the same time, but PULSIN and COUNT are generally bad, since your code can do NOTHING ELSE during the count interval.
If that is the case just do something like:
Code:CLEAR Topp: IF InputPin = 0 THEN Counter = 0 ENDIF IF Counter > 2 then goto PowerGone IF Counter < 254 THEN Counter = Counter + 1 Pause 5 Goto Topp PowerGone: HSEROUT ["Turn on the Generator"] Pause 10 END
Bookmarks