Ayuda con un sensor HC-SR04

Hola, necesito ayuda con un código. Necesito medir la aceleración, distancia y velocidad con el sensor ultrasonido, no tengo problema con la distancia pero al momento de tratar de conseguir la velocidad o aceleración no logro nada, he usado todas las formulas que conozco y he merodeado varios posts en busca de una solución pero ninguno me ha servido, espero puedan ayudarme, se los agradecería mucho ya que no encuentro una solución viable o tal vez me estoy saltando algo, también noto que mi problema principal es el tiempo.

Pd: adjunto mi código para Arduino UNO.

int trigger = 8;
int echo = 7;
int tiempo;
int distancia;
int velocidad;
int aceleracion;
int Vf;
int Vo;
int Tf;
int To;


void setup() 

{
Serial.begin(9600);
pinMode(echo, INPUT);
pinMode(trigger, OUTPUT);
}

void loop()

{
digitalWrite(trigger, HIGH);
delayMicroseconds(10);
digitalWrite(trigger, LOW);
tiempo=pulseIn(echo, HIGH);
distancia=tiempo/58;
To=tiempo;
Vo=distancia/To;

delay(500);

digitalWrite(trigger, HIGH);
delayMicroseconds(10);
digitalWrite(trigger, LOW);
tiempo=pulseIn(echo, HIGH);
distancia=tiempo/58;
Tf=tiempo;
Vf=distancia/Tf;
aceleracion=Vf-Vo/tiempo;

Serial.print("La distancia es: ");
Serial.println(distancia);
Serial.print("La velocidad es: ");
Serial.println(Vo);
Serial.print("El tiempo es: ");
Serial.println(To);
Serial.print("La aceleracion es: ");
Serial.println(aceleracion);
}

Integer arithmetic?

Please remember to use code tags when posting code

Sorry I'm new to posting and there are things I don't understand, thanks for the advice.

Yes it would be integrated arithmetic but my problem is the variables, in this case the time.

I think...

No, you are using integer arithmetic, when you probably want to use floating point arithmetic.