mmm, something is not clear in your explanation....
When you said, "PORTA.0 will be check for 30 second only" once PORTA.0=1 on or once you put the power on your PIC?
Let's say once your put the power on your pic...
Code:
TRISA = 255
TRISB = 0
CounterA VAR WORD
PB var PORTA.0
OUT1 VAR PORTB.0
OUT2 VAR PORTB.1
PORTB = 0 ' Clear all leds
CounterA = 0 ' Clear counter
Start:
while (CounterA<300) AND (PB=0)
pause 100
CounterA = CounterA + 1
wend
if CounterA>=300 then
OUT2 = 1
else
OUT1 = 1
endif
Spin: GOTO Spin
Last edited by mister_e; - 4th October 2007 at 02:37.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks