I am trying to make a delay timer for a relay. using a PIC 12c508a
I have some code but cannot find a compiler to turn it in to a hex file to burn it into the micro.
This is for a one time use and is vary small basic code.
Here is my code:
Device 12c508a
DECLARE XTAL 4
CONFIG WDT_OFF,INTRC_OSC,MCLRE_OFF,CP_OFF
DECLARE WATCHDOG OFF
TRISIO = %00001000 ' Make GPIO.3 an input
Symbol PIR = GPIO.3
Symbol RELAY = GPIO.2
DELAYMS 60000 'wait 60 seconds
DELAYMS 60000 'wait 60 seconds
DELAYMS 30000 'wait 30 seconds
CHECKIT:
IF PIR = 1 THEN 'check sensor
RELAY = 1 'turn on relay
DELAYMS 1000 'wait a second
RELAY = 0 'turn off relay
ENDIF
DELAYMS 30000 'pause 30 seconds
GOTO CHECKIT 'do it again
END
Can Some nice person Compile this for me!
Thanks
Steve
I have some code but cannot find a compiler to turn it in to a hex file to burn it into the micro.
This is for a one time use and is vary small basic code.
Here is my code:
Device 12c508a
DECLARE XTAL 4
CONFIG WDT_OFF,INTRC_OSC,MCLRE_OFF,CP_OFF
DECLARE WATCHDOG OFF
TRISIO = %00001000 ' Make GPIO.3 an input
Symbol PIR = GPIO.3
Symbol RELAY = GPIO.2
DELAYMS 60000 'wait 60 seconds
DELAYMS 60000 'wait 60 seconds
DELAYMS 30000 'wait 30 seconds
CHECKIT:
IF PIR = 1 THEN 'check sensor
RELAY = 1 'turn on relay
DELAYMS 1000 'wait a second
RELAY = 0 'turn off relay
ENDIF
DELAYMS 30000 'pause 30 seconds
GOTO CHECKIT 'do it again
END
Can Some nice person Compile this for me!
Thanks
Steve