CMCON... Again :o)
What about
Code:
Define OSCCAL_1K 1
CMCON=7 ' disable analog comparator
TRISIO=%11111110 ' set GPIO as output
' others as input
i VAR BYTE
low 0
pause 100
loop:
if GPIO.1=1 then turn1
if GPIO.2=1 then turn2
goto loop
turn1:
for i=0 to 5
pulsout 0, 147
pause 20
next i
goto loop
turn2:
for i=0 to 5
pulsout 0, 152
pause 20
next i
goto loop
Also, make sure you set MCLR pin to +5V OR you disable it at programming time.
Same for internal OSC.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks