frequset reading
KARIM102
Posts: 75
Hi everybody,
I wanna know how the stamp read the Frequent input from any sensor "Ex:Flow sensor"...
I wanna know how the stamp read the Frequent input from any sensor "Ex:Flow sensor"...
Comments
Bean
thx
[PHP]' {$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[/PHP]
I hope this helps