芯片解密stc89c52rc+ds18b20+tm1650孵化器温控器
- 芯片解密#include <STC89X52RC.H>
- 芯片解密#include <absacc.h>
- 芯片解密#include <intrins.h>
- 芯片解密#include <EEPROM.H>
- /*************************************************
- 常量、变量定义区
- ***************************************************/
- //常量定义
- #define true 1
- #define false 0
- #define uchar unsigned char
- #define uint unsigned int
- //数组定义
- uchar Display_Code[13]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x80,0x40,0x00};
- //共阴数码管段码 0, 1, 2, 3, 4 , 5, 6, 7, 8, 9, ., -, 不亮
- //uchar Display_16Code[16]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x77,0x7C,0x39,0x5E,0x79,0x71};
- //16进 制段码(用于显示键值)0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f
- uchar Dig_Bit_Code[4]={0x68,0x6a,0x6c,0x6e};//650位码
- uchar Light_Level_Code[8]={0x11,0x21,0x31,0x41,0x51,0x61,0x71,0x01};//亮度调节
- uchar keyvalue;
- uint wendu;//用于存储温度值
- uint maxwendu;
- uchar maxwenduH;//最高温度高8位
- uchar maxwenduL;//最高温度低8位
- uint minwendu;
- uchar minwenduH;//最低温度高8位
- uchar minwenduL;
- uchar menu=0, cou;//菜单标志,计数,cou1
- uint h;//温度计算使用
- uint temp;//温度返回值
- //uchar k;
- /***************************温度小数部分用查表法*****************/
- uchar ditab[16]=
- {0x00,0x01,0x01,0x02,0x03,0x03,0x04,0x04,0x05,0x06,0x06,0x07,0x08,0x08,0x09,0x09};
- uchar temp_data[2]={0x00,0x00};//读出温度暂存
- uchar display[5]={0x00,0x00,0x00,0x00,0x00};//显示单元数据,共4个数据和一个运算暂用
- //定义IO口
- sbit SDA=P3^7;
- sbit SCL=P3^6;
- //sbit beep=P1^4;
- sbit DQ=P1^1; //ds18b20温度输入口
- //sbit DIN=P1^3; //LED小数点控制
- /**********************************函数定义区************************************/
- //I2C相关
- /*******************************************************************************
- 功能:I2CWait
- 描述:I2C延时
- 参数:
- 返回:
- *******************************************************************************/
- void I2CWait(void)
- {_nop_();_nop_();_nop_();_nop_();
- }

芯片解密