Rev 380 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 380 | Rev 401 | ||
---|---|---|---|
Line 56... | Line 56... | ||
56 | // |
56 | // |
57 | SIGNAL(SIG_ADC) |
57 | SIGNAL(SIG_ADC) |
58 | //####################################################################################### |
58 | //####################################################################################### |
59 | { |
59 | { |
60 | static unsigned char kanal=0,state = 0; |
60 | static unsigned char kanal=0,state = 0; |
- | 61 | static unsigned int gier1, roll1, nick1; |
|
61 | ANALOG_OFF; |
62 | ANALOG_OFF; |
62 | switch(state++) |
63 | switch(state++) |
63 | { |
64 | { |
64 | case 0: |
65 | case 0: |
65 | AdWertGier = ADC; |
66 | gier1 = ADC; |
66 | kanal = 1; |
67 | kanal = 1; |
67 | ZaehlMessungen++; |
68 | ZaehlMessungen++; |
68 | break; |
69 | break; |
69 | case 1: |
70 | case 1: |
70 | AdWertRoll = ADC; |
71 | roll1 = ADC; |
71 | kanal = 2; |
72 | kanal = 2; |
72 | break; |
73 | break; |
73 | case 2: |
74 | case 2: |
74 | AdWertNick = ADC; |
75 | nick1 = ADC; |
75 | kanal = 4; |
76 | kanal = 4; |
76 | break; |
77 | break; |
77 | case 3: |
78 | case 3: |
78 | UBat = (3 * UBat + ADC / 3) / 4;//(UBat + ((ADC * 39) / 256) + 19) / 2; |
79 | UBat = (3 * UBat + ADC / 3) / 4;//(UBat + ((ADC * 39) / 256) + 19) / 2; |
79 | kanal = 6; |
80 | kanal = 6; |
Line 84... | Line 85... | ||
84 | kanal = 7; |
85 | kanal = 7; |
85 | break; |
86 | break; |
86 | case 5: |
87 | case 5: |
87 | Aktuell_ax = ADC - NeutralAccX; |
88 | Aktuell_ax = ADC - NeutralAccX; |
88 | AdWertAccNick = Aktuell_ax; |
89 | AdWertAccNick = Aktuell_ax; |
89 | kanal = 5; |
90 | kanal = 0; |
90 | break; |
91 | break; |
91 | case 6: |
92 | case 6: |
- | 93 | if(PlatinenVersion == 10) AdWertGier = (ADC + gier1) / 2; |
|
- | 94 | else AdWertGier = ADC + gier1; |
|
- | 95 | kanal = 1; |
|
- | 96 | break; |
|
- | 97 | case 7: |
|
- | 98 | if(PlatinenVersion == 10) AdWertRoll = (ADC + roll1) / 2; |
|
- | 99 | else AdWertRoll = ADC + roll1; |
|
- | 100 | kanal = 2; |
|
- | 101 | break; |
|
- | 102 | case 8: |
|
- | 103 | if(PlatinenVersion == 10) AdWertNick = (ADC + nick1) / 2; |
|
- | 104 | else AdWertNick = ADC + nick1; |
|
- | 105 | kanal = 5; |
|
- | 106 | break; |
|
- | 107 | case 9: |
|
92 | AdWertAccHoch = (signed int) ADC - NeutralAccZ; |
108 | AdWertAccHoch = (signed int) ADC - NeutralAccZ; |
93 | AdWertAccHoch += abs(Aktuell_ay) / 4 + abs(Aktuell_ax) / 4; |
109 | AdWertAccHoch += abs(Aktuell_ay) / 4 + abs(Aktuell_ax) / 4; |
94 | if(AdWertAccHoch > 1) |
110 | if(AdWertAccHoch > 1) |
95 | { |
111 | { |
96 | if(NeutralAccZ < 800) NeutralAccZ+= 0.02; |
112 | if(NeutralAccZ < 800) NeutralAccZ+= 0.02; |
Line 103... | Line 119... | ||
103 | Aktuell_az = ADC; |
119 | Aktuell_az = ADC; |
104 | Mess_Integral_Hoch += AdWertAccHoch; // Integrieren |
120 | Mess_Integral_Hoch += AdWertAccHoch; // Integrieren |
105 | Mess_Integral_Hoch -= Mess_Integral_Hoch / 1024; // dämfen |
121 | Mess_Integral_Hoch -= Mess_Integral_Hoch / 1024; // dämfen |
106 | kanal = 3; |
122 | kanal = 3; |
107 | break; |
123 | break; |
108 | case 7: |
124 | case 10: |
109 | tmpLuftdruck += ADC; |
125 | tmpLuftdruck += ADC; |
110 | if(++messanzahl_Druck >= 5) |
126 | if(++messanzahl_Druck >= 5) |
111 | { |
127 | { |
112 | MessLuftdruck = ADC; |
128 | MessLuftdruck = ADC; |
113 | messanzahl_Druck = 0; |
129 | messanzahl_Druck = 0; |