Go Down

Topic: get the direction using gps without compass  (Read 319 times) previous topic - next topic

bayannabulsi


Hello

I am using a gps with arduino to get the specific direction of the car ( north, south,,,etc) ,I got the  Latitude and Longitude but not the exact direction. is there any way to get it without using compass ?

spycatcher2k

Mrs Drew
-=-
http://www.uk-pcb.co.uk - UK PCB Fab Company
I will design & code for you, but I will also charge you (PM me)
If you don't like my answers, realize : I'm not being cheeky, I'm Just trying to prompt you to use your own brain/google etc.

jremington

#2
Jan 14, 2018, 01:44 am Last Edit: Jan 14, 2018, 01:45 am by jremington
You need to make at least two readings, and subtract the first from the second. More here.

Arduino supports only single precision floating point, which is not precise enough for the above calculation.

-dev

Quote from: spycatcher2
take 2 readings, and use a little maths.
Quote from: jremington
Arduino supports only single precision floating point, which is not precise enough for the above calculation.
NeoGPS is very careful to avoid losing precision in these calculations.  It is the only library that does this.

Method for calculating bearing (i.e., direction) between two locations is here and used in the NMEAaverage example here.  NeoGPS is also smaller, faster and more reliable than all other GPS libraries.   It is available from the Arduino IDE Library Manager, under the menu Sketch -> Include Library -> Manage Libraries.
Really, I used to be /dev.  :(

Robin2

take 2 readings, and use a little maths.
And the 2 readings must be some distance apart - not both at the same place. , The further apart the better.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up