Compteur de kilomètres pour les trajets en voiture

Bonjour,
Je suis entrain de créer uen appli pour un devoir.
Mon appli comptera les kilomètres parcourus en voiture a tous les trajets. Je cherche donc un code qui permet d'enregistrer le trajet exacte et de calculer la distace parcourue lors de ce trajet...
J'ai deja essayé d'utiliser le bloc "quand capteur position. position changé", mais je n'arrive pas un code qui enregistre les km parcourus dans un trajet, je n'a ipas trouvé de tutoriel sur ça.
Merci de votre aide
cordialement
Paul

Haven't you already had an answer to a very similar question here ?

Not exactly, i asked how to use tiny DB1 and how to add manually the traveled kilometers, thanks to all of you it worked and now I can add miself the traveled kilometers, but what I ask is how to create a code that automatically calculates the kilometers travelled, I need that when I press the start button the GPS starts recording how many kilometers I am doing.
It is not what I asked in my first question, the first one was how to store and how to manually enter a traveled ride...
thank you
Paul

It will take upto 30 seconds for the GPS to get a fix on your position, and then x seconds to get the next fix with locationChanged.

You will need a clock timer to get the time between fixes, then you can do the calcuations of distanced travelled / time to get your speed.

Here is a way to calculate total distance shown if you use a LineString.

The complete linestring distance app

2 Likes