Wrote a program to beep regularly with a given number of seconds between each beep. Useful for a lab where you're taking measurements every X seconds and don't want to keep an eye on a timer.
Problem is, the clock isn't very accurate and when I run this along side a stopwatch the difference is very noticeable indeed. Some beeps as as much as a fifth of a second out. May not seem like a lot, but I wonder if there's a way to improve the clock accuracy? Or is this more a problem of the program execution time being so variable?
Mmmm, X can be as low as a couple of seconds. I also think that, because it's checking a difference in time from the internal clock, the time for actually running the program shouldn't cause the intervals to drift too much cumulatively. A few ms delay in a beep is fine - as long as it's consistent. I suppose it would average out in the end, but the noticeable ebb and flow of the beeping during operation bugs me a bit.
Why would you only use the XYZALM (or whatever) for values of X greater than 10?
The noticeable ebb and flow comes from the fact that it probably takes several hundred milliseconds to run each iteration of your loop. The DM41 is not a fast calculator by any stretch of the imagination. Certainly much faster than the original HP-41CX but that speed improvement is not as pronounced as it is with, for example, the DM15 or DM11.
The ten-second figure comes from the manual for the Time Module (built into the 41CX), which gives this as a figure below which the accuracy of the timer goes a bit pear shaped.
There are only 10 kinds of people in the world: those who understand binary and those who do not.
it probably takes several hundred milliseconds to run each iteration of your loop.
That makes sense, although I'm surprised it is so high. I am being naïve (again) in expecting the same program steps to produce the same latency every iteration, aren't I?
The ten-second figure comes from the manual for the Time Module (built into the 41CX), which gives this as a figure below which the accuracy of the timer goes a bit pear shaped.
In suppose I could include a conditional test that uses the code here for small intervals and a repeating XYZALM for intervals longer than 10s, but I doubt there'd be much point.