Car RPM + Count?
SweLogan
Posts: 11
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..
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
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."
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 -->
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.