We have two sensors. We want to calculate the speed of an obj that passes infront of the sensors like a car. Firstly the obj passes infront of sensor1 and after infront of sensor2.Between the two sensors we have a 5 cm distance. We also have two led lights that we want to light up when the obj passes infront of the sensors. For example when an obj passes infront of the first sensor we want led1 to light up and when it passes infront of the second sensor we want led2 to light up. But we also need for the sensors to calculate the speed because we want them to recognize if the obj that passes through is a car or a human. If the obj has speed bigger than 60km/h the sensors sense that it is a car and light up the led lights if not it is a human and the led lights do not light up
the code I used does not work at all
I don't know what you did. I would do something like this.
This is just a template with some basic ideas.