Quote:
Originally Posted by t vago
You got coastdown testing to work? That would be cool!
|
Code:
//Coast down time
unsigned long coasttime(void){
int t1;
int t2;
int v1= instantvehiclespeed();
int ctime;
if (v1>parms[CoastSpeedMax]) {
t1=0;
t2=0;
}
if (v1 == parms[CoastSpeedMax]) {t1 = tank.time();}
if (v1 == parms[CoastSpeedMin]) {t2 = tank.time();}
ctime = t2 - t1;
return ctime;
}
//Coast down distance
unsigned long coastdistance(void){
int d1;
int d2;
int cdistance;
int v2 = instantvehiclespeed();
if (v2>parms[CoastSpeedMax]) {
d1=0;
d2=0;
}
if (v2 == parms[CoastSpeedMax]) {d1 = tank.distance();}
if (v2 == parms[CoastSpeedMin]) {d2 = tank.distance();}
cdistance = d2 - d1;
return cdistance;
}
This is my code, and it works
, but with "canadian" version. So I think it should be rewritten for your version.