Shop OBEX P1 Docs P2 Docs Learn Events
Measuring RPM's and display on 7 segment display — Parallax Forums

Measuring RPM's and display on 7 segment display

dbrakedbrake Posts: 2
edited 2007-08-20 13:43 in BASIC Stamp
I have a fan with 3 wires - one of the wires is to monitor the RPM's. For every 2 revlovtions = 1 pulse from the fan.

I have used the count command to count every pulse for 1 second. I can view the pulses in the Debug window. Now I want that figure to display on the 4 7-Segment display. I have modified the clock program to display this. The only problem is that the refresh rate is poor. This is due to the count command to count the amount of pulses in one second. How can I display the amount of RPM's in real time.

I'm using the BS2 chip on a Professional Devolopment Board.

I have worked out the number of pulses to the RPM's.
4000 RPM fan / 2 = 2000 pulses.
2000 pulses / 60 = 33.3 pulses for 1 second.

I take the COUNT COMMAND capture for 1 second and then mutliply the figure by 120.
30 pulses = 3600 RPM's

Works fine on the Debug Console - displays figure on the 7 Segment display, but each of the 7 Segment display updates 1 second later.

eg.
Display 1 = 0
1 second later = Display 2 = 0
1 second later = Display 3 = 6
Again, 1 second later = Display 4 = 3

Total number = 3600, it just takes 4 seconds to complete the sequence - I want it to update at least 1 second with all displays at the same time. I know it's a programing issue - it's beging to drive me insane.

Any suggestions?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-08-20 13:43
    Your program is doing exactly what you've asked it to do. It displays one digit at a time moving from one digit to another each time. If you want to display 4 digits, you have to call it 4 times. I don't know what's going on in the Main LOOP with the waiting for tic. I assume it's a leftover from the original clock program.

    Please, please, please, if you're going to modify an existing program for a new purpose, figure out what the program does first and how the pieces work together. You'll learn something about programming and you'll understand better what's going on as you modify it.
Sign In or Register to comment.