/branches/v0.60_MicroMag3_Nick666/trunc/compass.c |
---|
244,8 → 244,7 |
y_corr = y_axis * cos_roll; |
y_corr += z_axis * sin_roll; |
// Winkelberechnung |
// Winkelberechnung |
heading = atan2_i(x_corr, y_corr); |
if (heading < 0) heading = -heading; |
else heading = 360 - heading; |
/branches/v0.60_MicroMag3_Nick666/trunc/timer0.c |
---|
48,7 → 48,9 |
if (!cntKompass--) // Aufruf mit 10 Hz |
{ |
KompassValue = heading_MM3(); |
int heading; |
heading = heading_MM3(); |
KompassValue = (KompassValue * 7 + heading) / 8; // Filtern |
KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
cntKompass = 980; |
} |