Timer with Rev. D
Dr.No
Posts: 60
Using the Basic Stamp Rev. D
For X = 1 to Y
process = do nothing
next
if Y = 1000, how long is that in seconds?
I'm trying to get close to 1 second but it doesn't have to be precise.
I'm not sure how large Y can be either. 65536?
Thanks
For X = 1 to Y
process = do nothing
next
if Y = 1000, how long is that in seconds?
I'm trying to get close to 1 second but it doesn't have to be precise.
I'm not sure how large Y can be either. 65536?
Thanks
Comments
Pause 5000
equates to 5 seconds. Can I take it then that a
pause would not cut power to the pins or will it?
2) PAUSE does not change the I/O pins. The statements that cause problems with that are NAP and SLEEP
3) You'll have to measure the loop time yourself. EME Systems' website (www.emesystems.com) has some information on Stamp statement execution time, but it depends on the details of the statements involved.
FOR I = 1 to 10
Pause 100
NEXT
Since the "Pause" value is in milliseconds, doing 10 'pauses' of 100 milliseconds each gets you one second.
You might "tweak" this a little -- the 'For' and the 'Next" take around 1/2 millisecond each.
And I'll verify that a "pause" holds the output values of the pins, yes.
I think the Pause statement should work just fine.
I just need each routine to get the same shared time
without the pins turning off.
So if it's off by a millisecond it wouldn't matter.
Thanks again.