Shop OBEX P1 Docs P2 Docs Learn Events
Car RPM + Count? — Parallax Forums

Car RPM + Count?

SweLoganSweLogan Posts: 11
edited 2006-06-04 01:41 in BASIC Stamp
Hi, i try to build a RPM loggar for my car.
I cant get this code to work. I try with a wier and tappit to +, but i dont get some value..

' {$STAMP BS2}
' ------------------------------------------------------------------------------
' Program Description
' ------------------------------------------------------------------------------
' This program monitors and displays the frequency of a signal on Pin 0.
' ------------------------------------------------------------------------------
' I/O Definitions
' ------------------------------------------------------------------------------
FreqPin CON 0 ' frequency input pin
' ------------------------------------------------------------------------------
' Constants
' ------------------------------------------------------------------------------
OneSec CON 1000 ' one second - BS2
' OneSec CON 2500 ' BS2sx
' OneSec CON 3484 ' BS2p
' ------------------------------------------------------------------------------
' Variables
' ------------------------------------------------------------------------------
freq VAR Word ' frequency
' ------------------------------------------------------------------------------
' Program Code
' ------------------------------------------------------------------------------
Main:
COUNT FreqPin, OneSec, freq ' collect pulses for 1 second
DEBUG CLS, "Frequency: ", DEC freq, " Hz" ' display on DEBUG screen
GOTO Main ' do it again
END

Comments

  • steve_bsteve_b Posts: 1,563
    edited 2006-06-03 19:21
    What wire are you tapping to and do you get values some times but not others?
    Did you connect the ground from the car to the ground of your board/chip? You still need a reference for voltage readings.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-06-03 19:26
    This way (attached)?
    314 x 375 - 8K
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-06-03 20:15
    Swelogan -

    This can't be the program you used, since it contains errors that would have appeared when the program was sent through the Stamp Editor. OneSec is never defined, although it appears twice in this program. In both cases it is a comment.

    I sure hope the input wire is NOT going to the ignition coil!

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • SweLoganSweLogan Posts: 11
    edited 2006-06-04 01:15
    PJ Allen said...
    This way (attached)?
    What is that for? Please explane more.

    And i have not connected to the ignition coil.

    I just tested with a button och my labbord.
    But i did get some errors, when i puch the button i can get a value up to 4000hz. And that must be wrong.

    Give me some code to work with. My car is a peg 205 GTI 4 cyl.

    After i have get right RPM the stamp will send the data to my PC for statics.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-06-04 01:41
    SweLogan said...
    What is that for? Please explane more.
    As far as I'm concerned that's the "recommended" input (and test) circuit.· Now, evidently, you have a switch.· You can use a switch in place of the (red) wire that I showed.· Or not.
Sign In or Register to comment.