19,7 → 19,7 |
#define TL3 PIN_B1 // tlacitko S3 |
#define TL4 PIN_B0 // tlacitko S4 |
|
#define POWER_T4 PIN_A6 // ovladani optotriaku T3 |
#define POWER_T3 PIN_A6 // ovladani optotriaku T3 |
#define POWER_T4 PIN_A5 // ovladani optotriaku T4 |
#define POWER_T5 PIN_A4 // ovladani optotriaku T5 |
|
78,27 → 78,9 |
return (analog >> 5 ); // prumer = analog/32 |
} |
|
int16 teplota(void) |
float teplota(void) |
{ |
|
//BYTE CONST TEMP_CALLIBRATION[20] = {0x90,0xb7,0x19,0x15,0x36,0x54,0x50,0xb5,0,0x24}; |
|
/*int16 Temp; |
|
float32 Rpt; |
float32 Tpt; |
|
Rpt = 1.0*adc()*2350.0/1024.0; //zapojeni OZ -> R=U/Iconst |
|
#define A 3.90802e-3 |
#define B -5.802e-7 |
|
Tpt = (-A + sqrt(A*A - 4*B*(1.0 - Rpt/1000.0)))/2.0/B; |
|
|
|
*/ |
return adc(); |
return (0.674201*adc() - 294.35); |
} |
|
|
157,6 → 139,6 |
} |
|
lcd_gotoxy(1,2); |
printf(lcd_putc,"teplota: %ld\21C ",teplota()); |
printf(lcd_putc,"teplota: %3.1f\21C ",teplota()); |
} |
} |