PDA

View Full Version : frequset reading



KARIM102
11-18-2010, 06:09 PM
Hi everybody,
I wanna know how the stamp read the Frequent input from any sensor "Ex:Flow sensor"...

Bean
11-18-2010, 06:56 PM
Check out the COUNT command.

Bean

KARIM102
11-19-2010, 05:08 AM
yes i know the count but i would like to know how it use it???? i mean count use for count the pules, isn' it? but how actually it count them????

thx

sam_sam_sam
11-19-2010, 12:08 PM
Try this I have use this and work OK for starter



' {$STAMP BS2}
' {$PBASIC 2.5}
PushBtn PIN 0 ' pushbutton on P0
#SELECT $STAMP
#CASE BS2, BS2E
DurAdj CON $100 ' / 1
#CASE BS2SX
DurAdj CON $280 ' / 0.400
#CASE BS2P, BS2PX
DurAdj CON $37B ' / 0.287
#CASE BS2PE
DurAdj CON $163 ' / 0.720
#ENDSELECT
Capture CON 1000 ' 1 second This value need to be change to mach what you have
cycles VAR Word ' counted cycles

Main:
DO
COUNT PushBtn, (Capture */ DurAdj), cycles
DEBUG CR, " ", DEC cycles, CR
LOOP
END

I hope this helps

KARIM102
11-19-2010, 08:28 PM
thx a lot body