![]() |
MPH code?
Hey guys, I've been digging around on the forum in search of a working code that converts vss input to mph. I have found several attempts but all are inaccurate. My personal attempts have been inaccurate as well. You guys have appearently got a pretty accurate code for this somewhere as the Mpguino tells your mph. If anyone has a functional code could you please post it? I am trying to make a logical automatic transmission controller. Thank You
|
My Version of MPGuino Code uses this small code. Only change to MPGuino original should be the use of standard math functions:
Code:
unsigned long instantfuelperhour(){ |
Um I don't see how that code is relevant? I must have been unclear on what I am looking for. I need a standalone code to convert pps into mph. Thanks
|
Oh, I mixed up mph and gph :turtle:
Code:
unsigned long instantvehiclespeed(){ |
is it possible to put the codes easily into a single code block?
|
Of course not. The code above calculates the speed from the collected data, but to collected the data you have to put other code inside interrupt service routines, you need some global volatile variables and so on. Thats not like calculating the power of a value which can be written into a single function.
I think you should invest some time in learning about coding for microcontrollers, specialy interrupts, before you continue with your project. Trying to understand to MPGuino code in Arduino language would be a good step :thumbup: |
simple block code can be like
top: poll for a pulse start counting poll for another pulse (while counting) stop counting compute mph from the count do something with the mph goto top this won't track distance precisely, but with a hall effect vss it will give a snapshot of your speed every loop (with a reed switch you will be all over the place). This is the sort of thing arduino users do, and it has severe limitations, but is good for what you describe maybe. |
wo wo wo... why does having a reed switch make it all over the place? My project is an 88 toyota pickup with a chevy motor and trans. The trans is a 4l60e with a relucter gear. Does this mean the trans speed sensor is hall effect? Because I had the dash out of the truck and I've just been using a toyota speedo as my signal generator. It has a 4 pulse per revolution reed switch built in for cruise control. I've just been spinning it with a drill and getting very inaccurate readings. So your saying some of the codes I have written could potentially work with the actual speed sensor even tho they are inaccurate with the reed switch test speedo? Thanks for the reply!!!
|
why?!? I don't know exactly, just from observation. I have to average out several pulse lengths to get a reasonably steady reading from a reed switch.
|
On a side note, I see you are by the wabash river, I've noticed a number of meanders that have isolated pockets of indiana in illinois and vice versa,
Lawrenceville, il - Google Maps Given their isolation from their parent state, do people still live/use these lumps? And taxes/etc go to indiana? or do they have agreements with the host state for public services? or? |
All times are GMT -4. The time now is 06:09 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com