Rev 128 | Rev 304 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 128 | Rev 173 | ||
---|---|---|---|
Line 32... | Line 32... | ||
32 | } |
32 | } |
Line 33... | Line 33... | ||
33 | 33 | ||
34 | void SucheLuftruckOffset(void) |
34 | void SucheLuftruckOffset(void) |
35 | { |
35 | { |
- | 36 | unsigned int off; |
|
- | 37 | off = eeprom_read_byte(&EEPromArray[EEPROM_ADR_LAST_OFFSET]); |
|
- | 38 | if(off > 20) off -= 10; |
|
- | 39 | OCR0A = off; |
|
- | 40 | Delay_ms(100); |
|
36 | unsigned int off; |
41 | if(MessLuftdruck < 850) off = 0; |
37 | for(off=0; off < 250;off++) |
42 | for(; off < 250;off++) |
38 | { |
43 | { |
39 | OCR0A = off; |
44 | OCR0A = off; |
40 | Delay_ms(50); |
45 | Delay_ms(50); |
41 | printf("."); |
46 | printf("."); |
42 | if(MessLuftdruck < 900) break; |
47 | if(MessLuftdruck < 900) break; |
- | 48 | } |
|
43 | } |
49 | eeprom_write_byte(&EEPromArray[EEPROM_ADR_LAST_OFFSET], off); |
44 | DruckOffsetSetting = off; |
50 | DruckOffsetSetting = off; |
45 | Delay_ms(200); |
51 | Delay_ms(300); |
Line 46... | Line 52... | ||
46 | } |
52 | } |
47 | 53 | ||
Line 56... | Line 62... | ||
56 | ANALOG_OFF; |
62 | ANALOG_OFF; |
57 | switch(state++) |
63 | switch(state++) |
58 | { |
64 | { |
59 | case 0: |
65 | case 0: |
60 | wert = (signed int) AdNeutralGier - ADC; |
66 | wert = (signed int) AdNeutralGier - ADC; |
- | 67 | if(PlatinenVersion != 10) wert *= 2; |
|
61 | AccumulateGier += wert; // |
68 | AccumulateGier += wert; // |
62 | MessanzahlGier++; |
69 | MessanzahlGier++; |
63 | Mess_Integral_Gier += wert;// / 16; |
70 | Mess_Integral_Gier += wert;// / 16; |
64 | Mess_Integral_Gier2 += wert; |
71 | Mess_Integral_Gier2 += wert; |
65 | kanal = 1; |
72 | kanal = 1; |
66 | ZaehlMessungen++; |
73 | ZaehlMessungen++; |
67 | break; |
74 | break; |
68 | case 1: |
75 | case 1: |
69 | wert = (signed int) ADC - AdNeutralRoll; |
76 | wert = (signed int) ADC - AdNeutralRoll; |
- | 77 | if(PlatinenVersion != 10) wert *= 2; |
|
70 | Mess_IntegralRoll += wert; |
78 | Mess_IntegralRoll += wert; |
71 | Mess_IntegralRoll2 += wert; |
79 | Mess_IntegralRoll2 += wert; |
- | 80 | if(Mess_IntegralRoll > 310000L) Mess_IntegralRoll = -290000L; |
|
- | 81 | if(Mess_IntegralRoll <-310000L) Mess_IntegralRoll = 290000L; |
|
72 | if(ADC < 10) wert = -700; |
82 | if(ADC < 15) wert = -1000; |
- | 83 | if(ADC < 7) wert = -2000; |
|
73 | if(ADC > 1000) wert = +700; |
84 | if(ADC > 1010) wert = +1000; |
- | 85 | if(ADC > 1017) wert = +2000; |
|
74 | AccumulateRoll += wert; |
86 | AccumulateRoll += wert; |
75 | MessanzahlRoll++; |
87 | MessanzahlRoll++; |
76 | kanal = 2; |
88 | kanal = 2; |
77 | break; |
89 | break; |
78 | case 2: |
90 | case 2: |
79 | wert = (signed int) ADC - AdNeutralNick; |
91 | wert = (signed int) ADC - AdNeutralNick; |
- | 92 | if(PlatinenVersion != 10) wert *= 2; |
|
80 | Mess_IntegralNick += wert; |
93 | Mess_IntegralNick += wert; |
81 | Mess_IntegralNick2 += wert; |
94 | Mess_IntegralNick2 += wert; |
- | 95 | if(Mess_IntegralNick > 310000L) Mess_IntegralNick = -290000L; |
|
- | 96 | if(Mess_IntegralNick <-310000L) Mess_IntegralNick = 290000L; |
|
82 | if(ADC < 10) wert = -700; |
97 | if(ADC < 15) wert = -1000; |
- | 98 | if(ADC < 7) wert = -2000; |
|
83 | if(ADC > 1000) wert = +700; |
99 | if(ADC > 1010) wert = +1000; |
- | 100 | if(ADC > 1017) wert = +2000; |
|
84 | AccumulateNick += wert; |
101 | AccumulateNick += wert; |
85 | MessanzahlNick++; |
102 | MessanzahlNick++; |
86 | kanal = 4; |
103 | kanal = 4; |
87 | break; |
104 | break; |
88 | case 3: |
105 | case 3: |