Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 2204 → Rev 2205

/Transportables_Koptertool/PKT/branches/branch_FollowMeStep2/followme/followme.c
633,12 → 633,22
set_beep( 25, 0xffff, BeepNormal ); // kurzer Bestaetigungs-Beep
redraw = true;
 
//#define OFFLINE
#ifndef OFFLINE
int retcode = GPSMouse_Connect(); // Abfrage der GPS-Daten zum testen Quick an Dirty ;-)
if( retcode <= 0 )
{
return;
}
#endif
 
/* // DEBUG
NMEApos.lat = 520000000;
NMEApos.lon = 0;
Config.FM_Azimuth = 90;
Config.FM_Distance = 10000;
*/
 
while( true )
{
NMEApos.lat = NMEA.Latitude;
655,44 → 665,50
redraw = false;
}
 
//#################
//# DISTANCE TO TARGET
//#################
writex_gpspos( 1, 2, NMEApos.lat, MNORMAL, 0,0 ); // GPS-Maus: Latitude
writex_gpspos(10, 2, NMEApos.lon, MNORMAL, 0,0 ); // GPS-Maus: Longitude
 
//lcdx_printf_at_P( 0, 1, MNORMAL,0,0, PSTR("Distance: %3d Meter"), Config.FM_Distance );
followme_calculate_offset(Config.FM_Distance, Config.FM_Azimuth, &followMeOffset);
 
//#################
//# TARGET Azimuth
//#################
//lcdx_printf_at_P( 0, 2, MNORMAL, 0,0, PSTR(" Azimuth: %3d Grad"), Config.FM_Azimuth);
// DEBUG
writex_gpspos( 1, 6, (int32_t)Config.FM_Azimuth*100 , MNORMAL, 0, 0 );
writex_gpspos( 10, 6, (int32_t)Config.FM_Distance*100 , MNORMAL, 0, 0 );
writex_gpspos( 1, 7, (int32_t)followMeOffset.offset_lat*100 , MNORMAL, 0, 0 );
writex_gpspos( 10, 7, (int32_t)followMeOffset.offset_long*100 , MNORMAL, 0, 0 );
 
 
writex_gpspos( 1, 2, NMEApos.lat , MNORMAL,0,0 ); // GPS-Maus: Latitude
writex_gpspos(10, 2, NMEApos.lon, MNORMAL, 0,0 ); // GPS-Maus: Longitude
 
//followMeOffset.offset_lat = 10000;
//followMeOffset.offset_long = 10000;
 
followme_calculate_offset(Config.FM_Distance, Config.FM_Azimuth, &followMeOffset);
followme_add_offset(&NMEApos, &NMEATarget, &followMeOffset);
 
writex_gpspos( 1, 4, (int32_t)NMEATarget.lat , MNORMAL, 0,0 ); // Ziel Latitude
writex_gpspos(10, 4, (int32_t)NMEATarget.lon , MNORMAL, 0,0 ); // Ziel Longitude
writex_gpspos( 1, 4, (int32_t)NMEATarget.lat , MNORMAL, 0, 0 ); // Ziel Latitude
writex_gpspos(10, 4, (int32_t)NMEATarget.lon , MNORMAL, 0, 0 ); // Ziel Longitude
 
 
if( get_key_press(1 << KEY_ESC) )
{
#ifndef OFFLINE
GPSMouse_Disconnect();
#endif
break;
}
 
 
if( get_key_press(1 << KEY_ENTER) )
{
redraw = true;
redraw = true;
// break;
}
}
 
if( get_key_press(1 << KEY_MINUS) )
{
Config.FM_Azimuth -= 10;
redraw = true;
}
if( get_key_press(1 << KEY_PLUS) )
{
Config.FM_Azimuth += 10;
redraw = true;
}
}
}