Counting without time limit and comparing to variable
Manuel
Posts: 105
Hello
I want to count a hall effect sensor with my BS2sx but not within a time limit. I want to be counting all the time until i reach the value of·a variable(word size). I was thinking of the lookdown command and adding 1 to·another variable each time·the sensor reads a magnetic fiels,·until my lookdown command sees tey are the same.
Does anyone have a suggestion, correction, tip?
Everything you write is warmly welcome.
Thanks for all the help i may recieve.
Best Regards
Manuel C. Reinhard
I want to count a hall effect sensor with my BS2sx but not within a time limit. I want to be counting all the time until i reach the value of·a variable(word size). I was thinking of the lookdown command and adding 1 to·another variable each time·the sensor reads a magnetic fiels,·until my lookdown command sees tey are the same.
Does anyone have a suggestion, correction, tip?
Everything you write is warmly welcome.
Thanks for all the help i may recieve.
Best Regards
Manuel C. Reinhard
Comments
·· You might try something like:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Best Regards
Manuel C. Reinhard
·· Whoops!· Yes, it does...I had a BS2p in the board already when I tested the code, but as long as you have the PBASIC 2.5 syntax selected, you're fine.· You just need to change the Stamp directive to BS2sx.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Best Regards
Manuel C. Reinhard
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Best Regards
Manuel C. Reinhard
·· On the SX, it's possible, although I haven't checked the timing.· You could try it though.· Timing for the BS2, and I think the BS2sx can be found on Dr. Tacy Allen's website at www.emesystems.com·along with a wealth of other useful information!· · Check it out!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Best Regards
Manuel C. Reinhard
·· That is correct.· The DO...LOOP exits when the Target variable has been reached.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com