Rev 1942 | Rev 1943 | ||
---|---|---|---|
Line 79... | Line 79... | ||
79 | } |
79 | } |
80 | |
80 | |
81 | int16 teplota(void) |
81 | int16 teplota(void) |
82 | { |
82 | { |
83 | |
83 | |
84 | BYTE CONST TEMP_CALLIBRATION[20] = {0x90,0xb7,0x19,0x15,0x36,0x54,0x50,0xb5,0,0x24}; |
84 | //BYTE CONST TEMP_CALLIBRATION[20] = {0x90,0xb7,0x19,0x15,0x36,0x54,0x50,0xb5,0,0x24}; |
85 | |
85 | |
86 | int16 Temp; |
86 | /*int16 Temp; |
87 | |
87 | |
88 | /* float32 Rpt; |
88 | float32 Rpt; |
89 | float32 Tpt; |
89 | float32 Tpt; |
90 | |
90 | |
91 | Rpt = 1.0*adc()*2350.0/1024.0; //zapojeni OZ -> R=U/Iconst |
91 | Rpt = 1.0*adc()*2350.0/1024.0; //zapojeni OZ -> R=U/Iconst |
92 | |
92 | |
93 | #define A 3.90802e-3 |
93 | #define A 3.90802e-3 |
94 | #define B -5.802e-7 |
94 | #define B -5.802e-7 |
95 | |
95 | |
96 | Tpt = (-A + sqrt(A*A - 4*B*(1.0 - Rpt/1000.0)))/2.0/B; |
96 | Tpt = (-A + sqrt(A*A - 4*B*(1.0 - Rpt/1000.0)))/2.0/B; |
97 | */ |
- | |
98 | |
97 | |
99 | |
98 | |
100 | |
99 | |
- | 100 | */ |
|
101 | return Temp; |
101 | return adc(); |
102 | } |
102 | } |
103 | |
103 | |
104 | |
104 | |
105 | #int_TIMER2 |
105 | #int_TIMER2 |
106 | void Rtc(void) //40ms |
106 | void Rtc(void) //40ms |