# Thread: A Working RR Trip Meter

1. ## A Working RR Trip Meter

When I get out of town on some of my 4WD trips I use my Car Speedo’s trip meter either for resetting to 0.0 at the beginning of a track where I am looking for a track or turnoff that is not always marked on the map. I also use it to calculate fuel consumption especially in long sandy trips where the fuel consumption is greater than normal.

This got me thinking about making a RoadRunner screen with 2 or 3 trip meters, where you can either set the starting value to 0.0 and have it count up or set a distance and have it count backwards.

I have now got a basic working trip meter but need to get some feedback as to what to do next.

As a prototype I just used AutoIT as I don’t have any VB skills. This is the logic to how it works.

Read GPSLAT & GPSLON from RR work out the distance between this lat and long and the previous set you read. Add the difference to a counter.

then send the value of the counter back to RR as a custom label

On a test run in the car today over 12km on my Speedo I got 12.04 one-way and 12.02 in reverse

One thing I did notice that will have to be added to the code is not to increment the counter if the speed is less that 1km, sitting at the lights I was getting very small increments but over time they could add up

--------------------------------------------------------------------------
\$pi = 3.14159265358979
\$counter1 = 0.00
\$lat2 = rrget ("GPSLAT")
\$lon2 = rrget ("GPSLON")

while 1
\$lat1 = rrget ("GPSLAT")
\$lon1 = rrget ("GPSLON")
\$dist3 = distance(\$lat1, \$lon1, \$lat2, \$lon2)
;swap the points ready for next calculation
\$lat2 = \$lat1
\$lon2 = \$lon1
\$counter1 = \$counter1 + \$dist3
rrsnd ("!MYCTR", \$counter1)
sleep(1000)
wend
exit

I have the following AutoIt functions

rrget – will read a label from RR
rrsnd – will send back to RR a custom label
distance – calculates the distance between (\$lat1, \$lon1, \$lat2, \$lon2)

rrget and rrsnd were written by @cool dude back in march when I was playing around with getting a compass working, and he changed the VB SDK example so you can talk to the SDK it without the VB form.
--------------------------------------------------------------------------

All the mathematics are in the distance function
I found on the www a few different ways to calculate the distance between 2 geographical coordinates; I have used a formula that is based on spherical trigonometry which is supposed to be more accurate than some of the others

I would also like to see Average speed as a label

Why I have posted is to get some feedback on what to do next

Are there enough people that would like to have a trip meter as part of RR in which case we can ask Guino to add it to RR

Or I just continue using AutoIT and finish off the development myself and release it when I finish my 4WD skin

Thinking outside the box and on a comment Rustyboxx made is if you have 3 or 4 trip counters you could assign one for work mileage and save the counter to a file when you exit RR, probably even a description of the work trip.

2. subscribed

3. Maybe also have a variable gauge that by clicking will cycle through displays of things like:
Average speed
Time traveling
Current speed (To have it on the same page for ease)
Average time/distance between stops

and other such things that could maybe be customized.

4. This is a great idea Ash and one that would appear to have quite a few possibilities as Toaster pointed out. Excellent work on getting the complicated maths sussed, I can't believe you got it working and tested in such a short time.

I'll be keeping a close eye on this and encourage other members to express their interest and opinion as this is a feature that is well overdue.

Ash, I've got another idea for your 4wd skin if you get time. Catch me on msn later

5. Very interesting, subscribing to this idea

6. good idea

7. Ash, I just posted a link to this thread on DC. Hope you don't mind

8. Maybe Tissy in the RR clock thread could add the info you want to a screen in 1 of his flash clocks.
Great Idea BTW
Nice1 Ash

9. Ash, if you need a willing volunteer to test this.........

Page 1 of 5 12345 Last

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•