Using Counter
Rafael
Posts: 2
I am using a BS2 with Board of Education and a waveform generator set to square wave. I just started programming so I really don't know what I'm doing.
This is what I have so far:
Counter VAR Byte
INPUT 8
OUTPUT 7
COUNT 7, 10000, Counter
Main:
DEBUG DEC Counter
END
I have tried implementing a loop and also just using an input without output. I have tried counting pins 8 and 7 (input and output).
I want the debug message to give me the value of the amount of peaks that it detected from the square wave generator. I have the generator set to 2 Hz so in 10 seconds it should be displaying 40 peaks. However I keep getting random numbers or 0. Ultimately I want to send the value of the "Counter" variable to an LCD screen, I could use·any info for that too.
- Thanks
This is what I have so far:
Counter VAR Byte
INPUT 8
OUTPUT 7
COUNT 7, 10000, Counter
Main:
DEBUG DEC Counter
END
I have tried implementing a loop and also just using an input without output. I have tried counting pins 8 and 7 (input and output).
I want the debug message to give me the value of the amount of peaks that it detected from the square wave generator. I have the generator set to 2 Hz so in 10 seconds it should be displaying 40 peaks. However I keep getting random numbers or 0. Ultimately I want to send the value of the "Counter" variable to an LCD screen, I could use·any info for that too.
- Thanks
Comments
http://www.parallax.com/dl/docs/books/sw/Web-SW-v2.1.pdf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Do you have the generator and stamp grounds connected together ? If not, it won't work.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.iElectronicDesigns.com
·