hz reader and switching
hello
I·trying to·write the code for bs2 oem·,· for reading hz of 5v square wave and later trigger relay if the Freq is > 120hz
but dosent work
·thanks
·wilson
Post Edited (prochips) : 3/21/2007 4:44:12 AM GMT
I·trying to·write the code for bs2 oem·,· for reading hz of 5v square wave and later trigger relay if the Freq is > 120hz
but dosent work
·thanks
·wilson
Post Edited (prochips) : 3/21/2007 4:44:12 AM GMT
Comments
Everything looks OK.
Are you sure the the square wave is actually swinging the stamp pin 15 from 0 to 5v? Also, is the negative from the square wave source tied to the stamp's negative?
You can reduce the 10K resistor down to 100 ohms or so when inputing a ttl signal.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
The same applies to the frequency. Since you're counting for 1/2 second, the frequency you want to check will equal pulses * 2, not pulses.
And finally, in your code, when the value being checked equals 100, the state of the LED doesn't change. Is that what you intended?
-Phil