Have a look at the PB manual
http://melabs.com/resources/pbpmanual/5_75-5_76.htm#572
While..Wend
Have a look at the PB manual
http://melabs.com/resources/pbpmanual/5_75-5_76.htm#572
While..Wend
You did not specify if you mean "shorter" as in with fewer lines of code or "shorter" as in faster...
Here is a thread you may find interesting: http://www.picbasic.co.uk/forum/showthread.php?t=5335
Also, you may look at the Pauseus statement.
If you loop inside the snippet how do you feed the variable "NEW" with the updated value?Code:Code: COMPARER: IF OLD>NEW THEN GOTO OTHER TASK PAUSE 1 OLD=NEW GOTO COMPARER
Al.
All progress began with an idea
@ first ... your processor will be able to see a change only AFTER data have been collected ( La Pallice, french philosopher ).
from that, if you collect data once a second ( as written @ post #1 ) no need to scan value @ each millisecond ...
just place your test ONCE after data collection ( ADC conversion or serial value received ) and you won't loose any time !!!
no need to have a watching loop nor ...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks