Since SX/B only supports byte variables with a maximum value of 255, COUNT would be very limited.
If the signal is consistant you can use PULSIN which will give the width of the pulse. From that you can determine how many pulses would occur in a certain time period.
Bean.
As Bean suggests, you could use PULSIN to measure the high portion of the pulse, the another PULSIN to measure the low portion. From this you could derive the period and work out the count.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Jon Williams Applications Engineer, Parallax
I will need to give another look at PULSIN. My count input for 100ms would never exceed 70 so count would fit well into the 255. Since my signal is linear in relationship to shaft speed, I·think that PULSIN could work. I am just not as comfortable with it as I am COUNT.
I assume that PULSIN is the best and only way to input / calculate·shaft speed?
Comments
If the signal is consistant you can use PULSIN which will give the width of the pulse. From that you can determine how many pulses would occur in a certain time period.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012
Product web site: www.sxvm.com
"It's not getting what you want, it's wanting what you've got."
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I assume that PULSIN is the best and only way to input / calculate·shaft speed?