百度网盘下载地址(968):点击下载
#include <reg51.h>
#include <Intrins.h>
#include <LCD1602.H>
#include <math.H>
#define C02_write 0xa0 /* c02写地址 */
#define C02_read 0xa1 /* c02读地址 */
#define uchar unsigned char
#define uint unsigned int
sbit MAX6675_CS = P1 ^ 2; /* MAX6675冷端温度补偿,将K型热电偶信号转为数字信号 */
sbit MAX6675_SCK = P1 ^ 1;
sbit MAX6675_SO = P1 ^ 0;
sbit normal = P2 ^ 3; /* LED灯表示温度正常,过高,过低 */
sbit upper = P2 ^ 4;
sbit lower = P2 ^ 5;
sbit direction = P2 ^ 6;
sbit stop = P2 ^ 7;
sbit SCL = P1 ^ 3; /* EEPROM,256byte */
sbit SDA = P1 ^ 4;
sbit beep = P1 ^ 7; /* 蜂鸣器 */
bit ack, flag = 0, flag1 = 0;
uint tz;
int sth = 0, stl = 0, t_zhi = 0;
uchar data temp1[] = { '+', '1', '5', '0', '0', 0 }, temp2[] = { '-', '1', '0', '0', '0', 0 };
uchar data temp[7];
char code keytab[] = { 0xEE, 0xDE, 0xBE, 0x7E, 0xED, 0xDD, 0xBD, 0x7D, 0xEB, 0xDB, 0xBB, 0x7B, 0xE7, 0xD7, 0xB7, 0x77 };
unsigned char code str1[] = { "STH STL" }; /* system temperature high,low */
unsigned char code str2[] = { "PARAMTER STEUP" };
unsigned char code str3[] = { " " };
unsigned int testD2;