in reply to Calculate bearing between GPS coordinates
So this is Arduino related and not really about Perl, but all the code I've been hacking on prototyping in Perl and porting to C has gotten me a lot of progress. I suppose it is Perl related to some degree, as if it wasn't for me knowing Perl and all the experience I've gained about writing C/XS, I wouldn't be here.
I have the GPS connected to my Trinket Pro on battery, with a GPS unit and a 0.96", 128x32 pixel OLED screen. I also have a button to switch between the "home" display contents, and the "return" display contents, and a button that writes to EEPROM that saves the coordinates of the current location.
The idea is that I can press the "save" button before going on a long hike, and turn the unit off. Then, if I ever get lost, I turn it back on, press the "return screen" button, and it guides me back to my starting location. Here are the screen layouts (in all cases I obscure some of the numbers as to not give out my home location :) Also, all coordinates have been shaved to 5 decimal points which is one metre. We don't need to be more precise than that, so it allowed me to shave some screen area) All of the N|W locations are generated dynamically based on whether the headings are negative or positive:
Home display. Top line is the current date and time in UTC. Second line is fixed-width north heading along with current heading (direction). Third line is fixed-width east heading, followed by the number of satellites we're currently locked onto. Fourth line is altitude, followed by current speed in KM/h.
17.06.03 21:17:16 UTC N:051.11111 H:288 W:114.11111 s:6 A:1090 S:0.00
Return screen. First line is fixed-width north point of the destination we need to return to, followed by the distance in Km. Second line is the fixed-width west point we're returning to, followed by the direction in degrees we need to travel. Third line is the fixed-width north point that we're currently located followed by our current heading in degrees, and fourth line is our fixed-width west point followed by our current speed of travel in Km/h.
N:050.95355 K:38.687 W:114.58056 D:244.96 N:051.11111 H:288.07 W:114.11111 S:0.00
I have manually saved the coordinates of a location I'm driving to tomorrow (Bragg Creek, Alberta, Canada), and am going to give it a test run on that driving distance. Later this week, I will go for a hike about 8km and test the actual intended functionality. For now, I'm just going to do code cleanup, fix up a couple of tiny things, and if it all works after my tests this week, I'll be contemplating how I want to package it, and solder everything together.
I have not converted the awesome magnetic declination code into C yet, so the direction has not been calibrated. I'll hack together that code after the unit is packaged and field ready, before my first real life tests of it.
|
|---|