on Nov 24th, 2013, 12:29pm, TobyWhaymand wrote:To be honest I didn't think about 'PROCwait_1_second' that certainly is a clearer way of writing code. |
|
If you have some reason to want to keep using PROCwait_1_second please make sure you modify it so that it doesn't gobble up 100% CPU time whilst looping. As it stands it's another example of CPU-frying, battery-draining code (albeit that it has a limited duration)!
Most straightforwardly you can add a short WAIT in the loop:
Code: DEF PROCwait_1_second
TIME = 0
REPEAT
WAIT 1
UNTIL TIME >= 100
ENDPROC
But simply replacing the whole thing with a WAIT 100 is easier!
Richard.