Tach readout on 5 7-Segment Displays
msh5686
Posts: 70
I am working on a project that will use the feedback from a fan with a hall sensor to control the fan speed, then display the RPMs on a five 7-segment LEDs. To save space I am using SIPO shift registers to send the desired digits to each LED. The fan controller works fine and the debug display shows the correct RPMs. The LEDs work on their own (can have them count up and down, etc.), but my issue comes when I'm trying to join the two together. I save the Fan's speed under the variable RPMs and later in the code go to the following subroutine, called LEDs, to try and display this speed on the 5 7-segment displays.
LEDs:
HIGH Clear
SHIFTOUT Serial, Clock, 1, [RPMs]
PAUSE 100
RETURN
I get gibberish out on the LEDs from doing this. I know my issue is in getting the program to 'lookup' or convert the debugged value of RPMs to the corresponding digits I have specified as constants for the numbers 0 - 9 previously. I am somewhat new to this and would be grateful for any insight into how to get the LEDs to display the actual RPMs that are shown in the debug window. The rest of my program is attached if that will help. Thanks for the help.
LEDs:
HIGH Clear
SHIFTOUT Serial, Clock, 1, [RPMs]
PAUSE 100
RETURN
I get gibberish out on the LEDs from doing this. I know my issue is in getting the program to 'lookup' or convert the debugged value of RPMs to the corresponding digits I have specified as constants for the numbers 0 - 9 previously. I am somewhat new to this and would be grateful for any insight into how to get the LEDs to display the actual RPMs that are shown in the debug window. The rest of my program is attached if that will help. Thanks for the help.
Comments
You have to parse the digits out of RPMs and then shift those out as segment data (re. Digit0, Digit1, etc.) as appropriate.
Then you need to shift out a Digit4, a Digit1, and a Digit0