Could the formula be Velocidade(speed)=freq* Perimeter/18pulses * 3.6(m/s to km/h)???

If frequency is counts per second and there are 18 counts per revolution then you are correct. freq*Perimeter/18 is linear development in meters per second.

In the coding, Perimeter should be declared as a float . I would bracket the computation this way way and make the constant 18.0 for the floating point calculations.

yes on AVR (just a warning about a statement that has no effect likely) whereas it will fail for an ESP (too many characters for the underlying char type).

@cpalha
comments at the end of a line starts with a // in C++ (or use /* .... */)

1.96m is wheel by complete rotation.
messured time is shorter by 18 times.
millis() are 1000 more as 1 second.
3.6 multiplyer for m/s to km/h conversion.