I have been tying to make a device with arduino that would use two gps modules. So one sends gps cords and the other receives and compares its current location to the location of the sender and once the receiver gets a few meters from the sender an indicator led would turn on indicating the send is nearby and if you were to walk away from the sender the led would turn off. So my problem is i cant figure out how to compare the received and current values of cords to work accurately. This is what i have been trying to get to work i dont know if im going completing the wrong way with this i dont know if you can do some sort of radius and use that if someone could help me solve this i would greatly appreciate it. Example data received from sender Lat: 12.76433041 Lon: -54.74539143 from receiver Lat: 12.76433854 Lon: -54.74539435.
int destLat;
int currLat;
int destLon;
int currLng;
currLat = gps.location.lat();
destLat = Lat;
currLng = gps.location.lng();
destLon = Lon;
bool AreSame(float currLat, float destLat)
if fabs(currLat - destLat) < EPSILON;
{
if fabs(currLng - destLon) < EPSILON;
digitalWrite (4, HIGH);
}