📄 temperature.h
字号:
//*****************************************************************************
//
// 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -