Subversion Repositories FlightCtrl

Rev

Rev 366 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 366 Rev 370
Line 146... Line 146...
146
{
146
{
147
        signed int x_min=0,x_max=0,y_min=0,y_max=0,z_min=0,z_max=0;
147
        signed int x_min=0,x_max=0,y_min=0,y_max=0,z_min=0,z_max=0;
148
        uint8_t measurement=50,beeper=0;
148
        uint8_t measurement=50,beeper=0;
149
        unsigned int timer;
149
        unsigned int timer;
Line -... Line 150...
-
 
150
       
-
 
151
        GRN_ON;
-
 
152
        ROT_OFF;
150
       
153
       
151
        while (measurement)
154
        while (measurement)
152
        {
155
        {
Line 153... Line 156...
153
                //H_earth = MM3.x_axis*MM3.x_axis + MM3.y_axis*MM3.y_axis + MM3.z_axis*MM3.z_axis;
156
                //H_earth = MM3.x_axis*MM3.x_axis + MM3.y_axis*MM3.y_axis + MM3.z_axis*MM3.z_axis;
Line 161... Line 164...
161
                if (MM3.z_axis > z_max) z_max = MM3.z_axis;
164
                if (MM3.z_axis > z_max) z_max = MM3.z_axis;
162
                else if (MM3.z_axis < z_min) z_min = MM3.z_axis;
165
                else if (MM3.z_axis < z_min) z_min = MM3.z_axis;
Line 163... Line 166...
163
               
166
               
164
                if (!beeper)
167
                if (!beeper)
-
 
168
                {
-
 
169
                        ROT_FLASH;
165
                {
170
                        GRN_FLASH;
166
                        beeper = 50;
-
 
167
                        beeptime = 50;
171
                        beeper = 50;
168
                }
172
                }
Line 169... Line 173...
169
                beeper--;
173
                beeper--;
170
               
174
               
Line 204... Line 208...
204
        cos_nick = cos_f(MM3.NickGrad);
208
        cos_nick = cos_f(MM3.NickGrad);
205
        sin_roll = sin_f(MM3.RollGrad);
209
        sin_roll = sin_f(MM3.RollGrad);
206
        cos_roll = cos_f(MM3.RollGrad);
210
        cos_roll = cos_f(MM3.RollGrad);
Line 207... Line 211...
207
 
211
 
208
        // Offset der Achsen nur bei Bedarf (also hier) berücksichtigen
212
        // Offset der Achsen nur bei Bedarf (also hier) berücksichtigen
209
        x_axis = (MM3.x_axis - MM3_calib.X_off);
213
        x_axis = -(MM3.x_axis - MM3_calib.X_off);
210
        y_axis = (MM3.y_axis - MM3_calib.Y_off);
214
        y_axis = -(MM3.y_axis - MM3_calib.Y_off);
Line 211... Line 215...
211
        z_axis = (MM3.z_axis - MM3_calib.Z_off);       
215
        z_axis = -(MM3.z_axis - MM3_calib.Z_off);      
212
       
216
       
213
    // Neigungskompensation
217
    // Neigungskompensation