temperature.h

来自「一个LCD驱动程序」· C头文件 代码 · 共 74 行

H
74
字号
//*****************************************************************************
//
//  File........: Temperature.h
//
//  Author(s)...: ATMEL Norway
//
//  Target(s)...: ATmega169
//
//  Description.: Defines and prototypes for Temperature.c
//
//  Revisions...: 1.0
//
//  YYYYMMDD - VER. - COMMENT                                       - SIGN.
//
//  20021015 - 1.0  - File created                                  - LHM
//
//*****************************************************************************

// Function declarations
    void ADC_init (unsigned char);          //initialize the ADC
    void PWM_init (void);                //initialize Timer Counter 1
    void ADC_conversion (void);             //do a ADC_conversion, either differential or single-ended
    void Temp_calculation (int);            //calculate the temperature from the ADC-measurement
    void Temperature_regulation (void);     //"regulate" the temperature by setting heating or cooling LED/pin



/************************************************************************     
*                                                                       
*                 Vref = 1.263V                                                 
*                 _____                                                     
*                   |                                                   
*                   |
*                 -----   
*                 |   |
*                 |   |  R_1 = 10 Kohm
*                 |   |
*                 -----
*                   | 
*                   |---------------------X    ADC channel #0 
*                   | 
*                 -----
*                 |   |
*                 |   |  R_NTC = ? ohm   (10Kohm @ 25 degree celcius)
*                 |   |
*                 -----
*                   |
*                   |---------------------X    ADC channel #1
*                   |
*                   |
*                  ---  
*                   - 
*                  GND
*                   
************************************************************************/  

// Defines
    #define V_ref           1.263       // voltage-reference 

// NTC-thermistor defines
    #define Beta            3450.000    // the Beta-value for the NTC transitor
    #define R_th            10000.00    // the thermistor resistans @ 25 degree Celsius
    #define T_amb           298.0000    // the temperature in Kelvin for 25 degree Celsius
    #define T_zero          273.0000    // the temperature in Kelvin for 0 degree Celsius


    #define SingleEnded     0x00        
    #define Differential    0x10        
    #define Heater          0x7F        
    #define Cooler          0xEF 



⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?