The Museum of HP Calculators

HP Forum Archive 09

[ Return to Index | Top of Index ]

bicycle speedometer
Message #1 Posted by Tal on 19 Sept 2002, 3:47 a.m.

Hi, HP48 users!

I wrote this loop for a bicycle speedometer.

The program works fine except that the maximum speed is 5.6 revolution to second(that mean ~44Km/h).

I would appreciate it if someone could help me to achieve 60Km/s ~7.7Hz.

0 STIME TICKS DO DO 1 SRECV DROP2 TICKS DUP ROT - B\->R 64290.816 SWAP / " " SWAP + " Km/h." + 3 DISP 'j' INCR DROP UNTIL KEY END UNTIL 13 == END

Regards, Tal

      
Re: bicycle speedometer
Message #2 Posted by Tom (UK) on 19 Sept 2002, 7:38 a.m.,
in response to message #1 by Tal

"I would appreciate it if someone could help me to achieve 60Km/s ~7.7Hz."

Well if you train hard, eat the right food and don't drink too much (or find a long steep hill) then you may acheive this speed on a bycicle.

:-)

I have done some programming of the HP48 to create a stopwatch program using TICKS. However the time freezes every so often when the HP48 decides to go off and do something else (that I haven't asked it to do). I think the only way round this is to use system calls rather than RPL. I found this non-real time aspect of the HP48 is a bit disapointing.

Tom.

            
Re: bicycle speedometer
Message #3 Posted by Glen Kilpatrick on 19 Sept 2002, 1:06 p.m.,
in response to message #2 by Tom (UK)

Just a guess, but I believe the 48 series goes away occasionally for memory garbage collection. This may be forced by MEM (probably MEM DROP, we don't want that stack heading for the stars), so it seems reasonable that including this in a loop will most likely slow the first pass, but then ensure that subsequent loops run the same speed, and alternately, just putting those commands before the loop should suggest to the Yorke that it need not do any further checking in the loop (but I'm not totally convinced of this last myself).

Perhaps someone more versed with 48 performance can address this issue of garbage collection.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall