OSCCON = %01100000 ' Ocs set to 4 MHz
TRISIO = %00000000 ' Set all ports to outputs, in this example
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
input gpio.4 '<font color=red> make input</font color>
inpulse VAR Word
memory var word
low gpio.4 <font color = red> ' Now you make it an output</font color>
low gpio.3
start:
SEROUT 0, 2, [12]
start2:
PULSIN 1, 1, inpulse
if inpulse<50 then
read 5, memory
serout 0,2,[12,17, "Activating",13,"Failsafe :", #memory*10]
goto start2
else
endif
if gpio.4=1 then '<font color=red> still an output, are you wanting an input?</font color>
write 5, inpulse
serout 0,2,[12,17,"Failsafe",13,"Stored :", #inpulse*10]
high gpio.3
low gpio.4 '<font color=red> is and should be an output</font color>
else
low gpio.3
endif
SEROUT 0, 2, [17,22,#inpulse*10]
PAUSE 20
GOTO start
END
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks