|
Found the following on the Arduino forum:
#define DIV 120
#define FPM 5280
#define TIRCIR 7.56
#define PPR 123.2
long TIME = 1000000;//time constant to divide freq
long vsspulse = pulseIn(vss, HIGH);
float vssval = (vsspulse / TIME);
float MPHpulse = ((1 / vssval)/ 2);
byte MPH = ((MPHpulse / FPM) * (TIRCIR / PPR) * DIV);
The issue is that the Arduino does not know what volume your head unit is already at so it would be annoying if you are already blasting your music going 20mph. Then you will be deaf by the time you hit 60mph
|