| ??? 08/25/00 22:09 Read: times |
#4713 - RE: Making speedometer with 8051: |
A different approach that you could use would be to reset a count-down to, say, 125 following a tooth going by on the pickup. The countdown would be time dependent.
When the next pulse comes, send the value of the register to the display, and set it back to the initial value, to start counting down again. The faster you go, the less it has counted down, so that higher the number on the display. Calibration would consist of setting the initializing number, and the rate of count-down. (Since you really should only update the display like a few times per second, [10 seems too many to me], you could actually have a pretty slow counter, and use every 25th pulse, or 50th, etc. The pulses are goint to come pretty fast from the wheel, compared with the display update speed.) Or you could have a preset update speed, and have one process putting the value into the display register, and your pre-set refresh procedure reading the value out of it. |



