OK, I've been out of the PIC stuff for about a year now and have noticed some significant brain drain (on my behalf)
I am just trying to get back into the PICbasic with some simple LED blinking with a 12F683. I looked at some of my old code with controlled 3 LED's and the code (compiled) works just fine. But when I comment out 2 of the 3 LED's, the remaining LED just stays ON.
The code posted shows only GPIO.1 remaining active...but the LED stays on.
I know this is peanuts to all of you...but please help me out. I even tried a simple code with a simple loop! Still didn't work.
John.
Code:
osccon = %01100000 ' Ocs set to 4 MHz
trisio = %00000000 '
wpu = %00011000
'CMCON0 = 7 ' Analog comparators off
'ANSEL = 0 ' Analog select set to digital, pg 69 data
'ADCON0 = 0 ' A/D turned OFF, pg 68 of data
pausetime var word
Out0 var gpio.0
Out1 var gpio.1
Out2 var gpio.2
B0 var byte
' SET VARIABLES
pausetime = 200
B0 = 0
low 0
low 1
low 2
start:
'button gpio.3,1,10,5,B0,1,notp
if gpio.3 = 1 then goto start
'call blink0
'call blink2
call blink1
goto start
blink0:
high out0
pause pausetime
low out0
'pause pausetime
return
blink1:
high out1
pause pausetime
low out1
'pause pausetime
return
blink2:
high out2
pause pausetime
low out2
'pause pausetime
return
notp:
goto start
end
Bookmarks