开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Code Question


 

I am hoping somebody could explain this piece of code to me. ?I'm just stumped! I understand the basics of converting GPS coordinates to WSPR grid squares, and I can do it by hand with paper, pencil, and calculator. I'm just not connecting the dots on how the program is handling it.

Thank you!

Paul

______________________________________________________________________________________________________________________________________________________________________________________________

void loc8calc() // Calculates full locator from GPS
{
?
? lon = (gps.location.lng() * 100000) + 18000000L;
? lat = (gps.location.lat() * 100000) + ?9000000L;
?
? char MH[8] = {'A', 'A', '0', '0', 'A', 'A', '0', '0'}; // Full locator characters
?
? MH[0] += ?lon / 2000000;
? MH[1] += ?lat / 1000000;
? MH[2] += (lon % 2000000) / 200000;
? MH[3] += (lat % 1000000) / 100000;
? MH[4] += ((lon % 200000) / 8333);
? MH[5] += ((lat % 100000) / 4166);
? MH[6] += ((lon % 200000) % 8333) / 833;
? MH[7] += ((lat % 100000) % 4166) / 416;

Join [email protected] to automatically receive all group messages.