Rev 1662 | Rev 1695 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1662 | Rev 1687 | ||
---|---|---|---|
Line 111... | Line 111... | ||
111 | // |
111 | // |
112 | ISR(ADC_vect) |
112 | ISR(ADC_vect) |
113 | //####################################################################################### |
113 | //####################################################################################### |
114 | { |
114 | { |
115 | static unsigned char kanal=0,state = 0; |
115 | static unsigned char kanal=0,state = 0; |
- | 116 | static signed char subcount = 0; |
|
116 | static signed int gier1, roll1, nick1, nick_filter, roll_filter; |
117 | static signed int gier1, roll1, nick1, nick_filter, roll_filter; |
117 | static signed int accy, accx,subcount = 0; |
118 | static signed int accy, accx; |
118 | - | ||
119 | static long tmpLuftdruck = 0; |
119 | static long tmpLuftdruck = 0; |
120 | static char messanzahl_Druck = 0; |
120 | static char messanzahl_Druck = 0; |
121 | switch(state++) |
121 | switch(state++) |
122 | { |
122 | { |
123 | case 0: |
123 | case 0: |
Line 160... | Line 160... | ||
160 | if(AdWertAccHoch > 1) |
160 | if(AdWertAccHoch > 1) |
161 | { |
161 | { |
162 | if(NeutralAccZ < 750) |
162 | if(NeutralAccZ < 750) |
163 | { |
163 | { |
164 | subcount += 2; |
164 | subcount += 2; |
165 | if(modell_fliegt < 500) subcount += 100; |
165 | if(modell_fliegt < 500) subcount += 10; |
166 | } |
166 | } |
167 | if(subcount > 1000) { NeutralAccZ++; subcount -= 1000;} |
167 | if(subcount > 100) { NeutralAccZ++; subcount -= 100;} |
168 | } |
168 | } |
169 | else if(AdWertAccHoch < -1) |
169 | else if(AdWertAccHoch < -1) |
170 | { |
170 | { |
171 | if(NeutralAccZ > 550) |
171 | if(NeutralAccZ > 550) |
172 | { |
172 | { |
173 | subcount -= 2; |
173 | subcount -= 2; |
174 | if(modell_fliegt < 500) subcount -= 100; |
174 | if(modell_fliegt < 500) subcount -= 10; |
175 | if(subcount < -1000) { NeutralAccZ--; subcount += 1000;} |
175 | if(subcount < -100) { NeutralAccZ--; subcount += 100;} |
176 | } |
176 | } |
177 | } |
177 | } |
178 | /* |
178 | /* |
179 | AdWertAccHoch = (signed int) ADC - NeutralAccZ_float; |
179 | AdWertAccHoch = (signed int) ADC - NeutralAccZ_float; |
180 | if(AdWertAccHoch > 1) |
180 | if(AdWertAccHoch > 1) |