Cenlasoft
07-16-2009, 09:30 AM
Hello,
I have written the following for my demo prop board:
CON
_clkmode = xtal1 + pll16x···················· ' Crystal and PLL settings
_xinfreq = 5_000_000························· ' 5 MHz crystal
OBJ
sqw···· : "ECASquareWave"························ ' Square wave object
VAR
pub go
sqw.Freq(5, 0, 353_000)·················· ' Send 353 KHz
repeat
The code sends out a square wave on pin 5. It works. The square wave excites an LC circuit and produces 3 volts DC at resonance after rectifying. I have routed the output (3 VDC) to pin 1 of the prop. When I put a metal object near the coil, It lowers the voltage to about 1.3 VDC or lower. I want to read pin 1 and display if its high or low. If its high, an led should be lit, if low, the led should go off. How can I modify this code to do this?
Thanks,
Cenlasoft
I have written the following for my demo prop board:
CON
_clkmode = xtal1 + pll16x···················· ' Crystal and PLL settings
_xinfreq = 5_000_000························· ' 5 MHz crystal
OBJ
sqw···· : "ECASquareWave"························ ' Square wave object
VAR
pub go
sqw.Freq(5, 0, 353_000)·················· ' Send 353 KHz
repeat
The code sends out a square wave on pin 5. It works. The square wave excites an LC circuit and produces 3 volts DC at resonance after rectifying. I have routed the output (3 VDC) to pin 1 of the prop. When I put a metal object near the coil, It lowers the voltage to about 1.3 VDC or lower. I want to read pin 1 and display if its high or low. If its high, an led should be lit, if low, the led should go off. How can I modify this code to do this?
Thanks,
Cenlasoft