Hi, and welcome here !
Please, next time tell us which PIC # you're using 
I see some things wrong here
should be 4,8 or whatever else crystal value you're using. Assuming you MAY use a 12F683 you will need to set the OSCCON register instead.
4MHz is the default speed, you don't really need to tell it to the compiler.
<hr>
NEXT!
it miss something here.. like a value 
Code:
M_BUT con GPIO.0 'Name bit 0 of GPIO to Momentary Button
LED con GPIO.1 'Name bit 1 of GPIO to LED
PUMP con GPIO.2 'Name bit 2 of GPIO to Pump
FAN con GPIO.3 'Name bit 3 of GPIO to Fan
use VAR instead of CON will solve the problem.
Code:
ON_OFF VAR bit
ON_OFF = 1
X0 VAR BYTE
PUMP_RUN: 'This is defined for the pump on/off
X0= 0
pump = 0 'Turn misting pump on
LED_RUN: 'LED Flash loop begins here
if X0 < 10 then
gosub LED_F
else
LED = 0 'Makes sure LED is off
pump = 0 'Turns relay controlling the pump off
return 'Returns to main code
endif
LED_F:
LED = 1 'Turns on the warning LED
pause 500 'Pause 500mS (1/2 second) with LED on
LED = 0 'Turns off warning LED
pause 500 'Pause 500mS (1/2 second) with LED off
X0 = X0 + 1 'This adds 1 to variable X0 each time it loops
goto LED_RUN 'Returns to begining of LED Flash loop
It compile without error... not sure if it do what you need
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks