Browse Source

完成全部功能

master
htujun 3 years ago
parent
commit
7cb8f84a5f
  1. 4
      .vscode/keil-assistant.log
  2. 2
      .vscode/uv4.log.lock
  3. 135
      DS18B20.LST
  4. BIN
      DS18B20.OBJ
  5. 1
      DS18B20.__i
  6. 108
      DS18B20.c
  7. 11
      DS18B20.h
  8. 324
      Light.LST
  9. 1
      Light.__i
  10. 297
      Light.c
  11. 12
      ds1302.LST
  12. BIN
      ds1302.OBJ
  13. 4
      ds1302.c
  14. 6
      lcd.LST
  15. BIN
      lcd.OBJ
  16. 2
      lcd.h
  17. 769
      main.LST
  18. BIN
      main.OBJ
  19. 446
      main.c
  20. BIN
      pro
  21. 1575
      pro.M51
  22. 10
      pro.build_log.htm
  23. 591
      pro.hex
  24. 3
      pro.lnp
  25. 69
      pro.uvgui.QY
  26. 14
      pro.uvopt
  27. 5
      pro.uvproj

4
.vscode/keil-assistant.log vendored

@ -1,2 +1,6 @@ @@ -1,2 +1,6 @@
[info] Log at : 2022/4/29|01:03:00|GMT+0800
[info] Log at : 2022/4/30|17:48:13|GMT+0800
[info] Log at : 2022/4/30|20:14:44|GMT+0800

2
.vscode/uv4.log.lock vendored

@ -1 +1 @@ @@ -1 +1 @@
2022/4/29 1:06:45
2022/4/30 20:16:59

135
DS18B20.LST

@ -0,0 +1,135 @@ @@ -0,0 +1,135 @@
C51 COMPILER V9.56.0.0 DS18B20 04/30/2022 20:50:18 PAGE 1
C51 COMPILER V9.56.0.0, COMPILATION OF MODULE DS18B20
OBJECT MODULE PLACED IN DS18B20.OBJ
COMPILER INVOKED BY: D:\Keil_v5\C51\BIN\C51.EXE DS18B20.c OPTIMIZE(8,SPEED) BROWSE DEBUG OBJECTEXTEND TABS(2)
line level source
1 #include "DS18B20.h"
2
3 sbit DS18B20=P3^2; //定义数据线
4
5 void delay_ms(unsigned int x)//延时1ms
6 {
7 1 unsigned int y,z;
8 1 for(y=x;y>0;y--)
9 1 for(z=110;z>0;z--);
10 1 }
11
12 uchar DS18B20_Init() //初始化。成功返回1,不成功返回0.
13 {
14 1 uchar i;
15 1 DS18B20 = 0; //将总线拉低480微秒~960微秒
16 1 i = 70;
17 1 while(i--); //延时642微秒
18 1 DS18B20 = 1; //拉高总线,等待后续反馈
19 1 i = 0;
20 1 while(DS18B20) //等待DS18B20拉低总线
21 1 {
22 2 delay_ms(1); //定义的延迟1ms的延迟函数
23 2 i++;
24 2 if(i>5) //等待5ms以上
25 2 {
26 3 return 0; //初始化失败
27 3 }
28 2 }
29 1 return 1; //初始化成功
30 1 }
31
32 uchar DS18B20_ReadByte() //通过读取8次状态位达到读取字节的目的
33 {
34 1 uchar byte, bi;
35 1 uint i, j;
36 1 for(j=8; j>0; j--)
37 1 {
38 2 DS18B20 = 0; //先将总线拉低
39 2 i++;
40 2 DS18B20 = 1; //然后释放总线
41 2 i++;
42 2 i++; //延时6微秒等待数据稳定
43 2 bi = DS18B20; //读取数据,从最低位开始读取
44 2 byte = (byte >> 1) | (bi << 7); //从最低位开始记录,将byte依次右移
45 2 i = 4; //读取完之后等待48微秒再接着读取下一个数
46 2 while(i--);
47 2 }
48 1 return byte; //将读取完的字节保存
49 1 }
50
51 void DS18B20_WriteByte(uchar dat)//函数通过循环写8个位实现写一个字节
52 {
53 1 uint i, j;
54 1 for(j=0; j<8; j++)
55 1 {
C51 COMPILER V9.56.0.0 DS18B20 04/30/2022 20:50:18 PAGE 2
56 2 DS18B20 = 0; //每写入一位数据之前先把总线拉低
57 2 i++;
58 2 DS18B20 = dat & 0x01; //然后写入一个数据,从最低位开始
59 2 i=6;
60 2 while(i--); //延时68微秒
61 2 DS18B20 = 1; //释放总线,给总线1微秒恢复时间才能接着写入下一位
62 2 dat >>= 1;
63 2 }
64 1 }
65
66 int DS18B20_ReadTemp() //读取的温度有两个字节,分别用tml和tmh存储两个字节
67 {
68 1 int temp = 0;
69 1 uchar tmh, tml;
70 1 DS18B20_Init(); //传感器初始化
71 1 delay_ms(1); //延时1微秒
72 1 DS18B20_WriteByte(0xcc); //跳过读取序列号操作
73 1 DS18B20_WriteByte(0x44); //温度转换指令
74 1 //完成温度转换功能
75 1 DS18B20_Init(); //传感器初始化
76 1 delay_ms(1);
77 1 DS18B20_WriteByte(0xcc); //跳过读取序列号操作
78 1 DS18B20_WriteByte(0xbe); //发送读取温度指令
79 1 //然后等待转换完后发送读取温度命令
80 1 tml = DS18B20_ReadByte(); //读取温度值共16位,先读低字节
81 1 tmh = DS18B20_ReadByte(); //再读高字节
82 1 temp = tmh; //先存高字节,后面通过移位存储低字节
83 1 temp <<= 8;
84 1 temp |= tml;
85 1 return temp;
86 1 }
87
88
89 uint Temper_change()
90 {
91 1 uint temper;
92 1 float tp;
93 1 //temper=read_temper();
94 1 temper=DS18B20_ReadTemp();
95 1 if(temper<0) //考虑负温度的情况
96 1 {
97 2 temper=temper-1;
98 2 temper=~temper;
99 2 tp=temper*0.0625; //16位温度转换成10进制的温度
100 2 temper=tp*100+0.5; //留两个小数点,并四舍五入
101 2 }
102 1 else
103 1 {
104 2 tp=temper*0.0625; //16位温度转换成10进制的温度
105 2 temper=tp*100+0.5; //留两个小数点,并四舍五入
106 2 }
107 1 return temper;
108 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 307 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 7
IDATA SIZE = ---- ----
C51 COMPILER V9.56.0.0 DS18B20 04/30/2022 20:50:18 PAGE 3
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)

BIN
DS18B20.OBJ

Binary file not shown.

1
DS18B20.__i

@ -0,0 +1 @@ @@ -0,0 +1 @@
"DS18B20.c" OPTIMIZE (8,SPEED) BROWSE DEBUG OBJECTEXTEND TABS (2)

108
DS18B20.c

@ -0,0 +1,108 @@ @@ -0,0 +1,108 @@
#include "DS18B20.h"
sbit DS18B20=P3^2; //定义数据线
void delay_ms(unsigned int x)//延时1ms
{
unsigned int y,z;
for(y=x;y>0;y--)
for(z=110;z>0;z--);
}
uchar DS18B20_Init() //初始化。成功返回1,不成功返回0.
{
uchar i;
DS18B20 = 0; //将总线拉低480微秒~960微秒
i = 70;
while(i--); //延时642微秒
DS18B20 = 1; //拉高总线,等待后续反馈
i = 0;
while(DS18B20) //等待DS18B20拉低总线
{
delay_ms(1); //定义的延迟1ms的延迟函数
i++;
if(i>5) //等待5ms以上
{
return 0; //初始化失败
}
}
return 1; //初始化成功
}
uchar DS18B20_ReadByte() //通过读取8次状态位达到读取字节的目的
{
uchar byte, bi;
uint i, j;
for(j=8; j>0; j--)
{
DS18B20 = 0; //先将总线拉低
i++;
DS18B20 = 1; //然后释放总线
i++;
i++; //延时6微秒等待数据稳定
bi = DS18B20; //读取数据,从最低位开始读取
byte = (byte >> 1) | (bi << 7); //从最低位开始记录,将byte依次右移
i = 4; //读取完之后等待48微秒再接着读取下一个数
while(i--);
}
return byte; //将读取完的字节保存
}
void DS18B20_WriteByte(uchar dat)//函数通过循环写8个位实现写一个字节
{
uint i, j;
for(j=0; j<8; j++)
{
DS18B20 = 0; //每写入一位数据之前先把总线拉低
i++;
DS18B20 = dat & 0x01; //然后写入一个数据,从最低位开始
i=6;
while(i--); //延时68微秒
DS18B20 = 1; //释放总线,给总线1微秒恢复时间才能接着写入下一位
dat >>= 1;
}
}
int DS18B20_ReadTemp() //读取的温度有两个字节,分别用tml和tmh存储两个字节
{
int temp = 0;
uchar tmh, tml;
DS18B20_Init(); //传感器初始化
delay_ms(1); //延时1微秒
DS18B20_WriteByte(0xcc); //跳过读取序列号操作
DS18B20_WriteByte(0x44); //温度转换指令
//完成温度转换功能
DS18B20_Init(); //传感器初始化
delay_ms(1);
DS18B20_WriteByte(0xcc); //跳过读取序列号操作
DS18B20_WriteByte(0xbe); //发送读取温度指令
//然后等待转换完后发送读取温度命令
tml = DS18B20_ReadByte(); //读取温度值共16位,先读低字节
tmh = DS18B20_ReadByte(); //再读高字节
temp = tmh; //先存高字节,后面通过移位存储低字节
temp <<= 8;
temp |= tml;
return temp;
}
uint Temper_change()
{
uint temper;
float tp;
//temper=read_temper();
temper=DS18B20_ReadTemp();
if(temper<0) //考虑负温度的情况
{
temper=temper-1;
temper=~temper;
tp=temper*0.0625; //16位温度转换成10进制的温度
temper=tp*100+0.5; //留两个小数点,并四舍五入
}
else
{
tp=temper*0.0625; //16位温度转换成10进制的温度
temper=tp*100+0.5; //留两个小数点,并四舍五入
}
return temper;
}

11
DS18B20.h

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
#ifndef __DS18B20_H__
#define __DS18B20_H__
#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int
uint Temper_change();
void delay_ms(unsigned int x);//延时1ms
#endif

324
Light.LST

@ -0,0 +1,324 @@ @@ -0,0 +1,324 @@
C51 COMPILER V9.56.0.0 LIGHT 04/30/2022 20:06:41 PAGE 1
C51 COMPILER V9.56.0.0, COMPILATION OF MODULE LIGHT
OBJECT MODULE PLACED IN Light.OBJ
COMPILER INVOKED BY: D:\Keil_v5\C51\BIN\C51.EXE Light.c OPTIMIZE(8,SPEED) BROWSE DEBUG OBJECTEXTEND TABS(2)
line level source
1 #ifndef __LIGHT_H_
2 #define __LIGHT_H_
3
4 #include <REG51.H>
5 #include <math.h> //Keil library
6 #include <stdio.h> //Keil library
7
8
9 #define SlaveAddress 0x46 //定义器件在IIC总线中的从地址,根据ALT ADDRESS地址引脚不同修改
10 //ALT ADDRESS引脚接地时地址为0x46,接电源时地址为0xB8
11
12
13 sbit SCL=P1^0; //IIC时钟引脚定义
14 sbit SDA=P1^1; //IIC数据引脚定义
15
16
17 typedef unsigned short WORD;
18
19 unsigned char BUF[8]; //接收数据缓存区
20
21 int dis_data; //变量
22
23 void delay_nms(unsigned int k);
24 void InitLcd();
25 void Init_BH1750(void);
26 void WriteDataLCM(uchar dataW);
*** ERROR C141 IN LINE 26 OF Light.c: syntax error near 'dataW', expected ')'
27 void WriteCommandLCM(uchar CMD,uchar Attribc);
*** ERROR C141 IN LINE 27 OF Light.c: syntax error near 'CMD', expected ')'
28 void DisplayOneChar(uchar X,uchar Y,uchar DData);
*** ERROR C141 IN LINE 28 OF Light.c: syntax error near 'X', expected ')'
29 void conversion(uint temp_data);
*** ERROR C141 IN LINE 29 OF Light.c: syntax error near 'temp_data', expected ')'
30
31 void Single_Write_BH1750(uchar REG_Address); //单个写入数据
*** ERROR C141 IN LINE 31 OF Light.c: syntax error near 'REG_Address', expected ')'
32 uchar Single_Read_BH1750(uchar REG_Address); //单个读取内部寄存器数据
*** ERROR C129 IN LINE 32 OF Light.c: missing ';' before 'Single_Read_BH1750'
33 void Multiple_Read_BH1750(); //连续的读取内部寄存器数据
34 //------------------------------------
35 void Delay5us();
36 void Delay5ms();
37 void BH1750_Start(); //起始信号
38 void BH1750_Stop(); //停止信号
39 void BH1750_SendACK(bit ack); //应答ACK
40 bit BH1750_RecvACK(); //读ack
41 void BH1750_Sendunsigned char(unsigned char dat); //IIC单个字节写
42 unsigned char BH1750_Recvunsigned char(); //IIC单个字节读
43
44
45 //-----------------------------------
46
47 //*********************************************************
48 void conversion(uint temp_data) // 数据转换出 个,十,百,千,万
49 {
C51 COMPILER V9.56.0.0 LIGHT 04/30/2022 20:06:41 PAGE 2
50 wan=temp_data/10000+0x30 ;
51 temp_data=temp_data%10000; //取余运算
52 qian=temp_data/1000+0x30 ;
53 temp_data=temp_data%1000; //取余运算
54 bai=temp_data/100+0x30;
55 temp_data=temp_data%100; //取余运算
56 shi=temp_data/10+0x30;
57 temp_data=temp_data%10; //取余运算
58 ge=temp_data+0x30;
59 }
60
61 //毫秒延时**************************
62 void delay_nms(unsigned int k)
63 {
64 unsigned int i,j;
65 for(i=0;i<k;i++)
66 {
67 for(j=0;j<121;j++)
68 {;}}
69 }
70
71 /*******************************/
72 void WaitForEnable(void)
73 {
74 DataPort=0xff;
75 LCM_RS=0;LCM_RW=1;_nop_();
76 LCM_EN=1;_nop_();_nop_();
77 while(DataPort&0x80);
78 LCM_EN=0;
79 }
80 /*******************************/
81 void WriteCommandLCM(uchar CMD,uchar Attribc)
82 {
83 if(Attribc)WaitForEnable();
84 LCM_RS=0;LCM_RW=0;_nop_();
85 DataPort=CMD;_nop_();
86 LCM_EN=1;_nop_();_nop_();LCM_EN=0;
87 }
88 /*******************************/
89 void WriteDataLCM(uchar dataW)
90 {
91 WaitForEnable();
92 LCM_RS=1;LCM_RW=0;_nop_();
93 DataPort=dataW;_nop_();
94 LCM_EN=1;_nop_();_nop_();LCM_EN=0;
95 }
96 /***********************************/
97 void InitLcd()
98 {
99 WriteCommandLCM(0x38,1);
100 WriteCommandLCM(0x08,1);
101 WriteCommandLCM(0x01,1);
102 WriteCommandLCM(0x06,1);
103 WriteCommandLCM(0x0c,1);
104 }
105 /***********************************/
106 void DisplayOneChar(uchar X,uchar Y,uchar DData)
107 {
108 Y&=1;
109 X&=15;
110 if(Y)X|=0x40;
111 X|=0x80;
C51 COMPILER V9.56.0.0 LIGHT 04/30/2022 20:06:41 PAGE 3
112 WriteCommandLCM(X,0);
113 WriteDataLCM(DData);
114 }
115
116 /**************************************
117 延时5微秒(STC90C52RC@12M)
118 不同的工作环境,需要调整此函数,注意时钟过快时需要修改
119 当改用1T的MCU时,请调整此延时函数
120 **************************************/
121 void Delay5us()
122 {
123 _nop_();_nop_();_nop_();_nop_();
124 _nop_();_nop_();_nop_();_nop_();
125 _nop_();_nop_();_nop_();_nop_();
126 _nop_();_nop_();_nop_();_nop_();
127 }
128
129 /**************************************
130 延时5毫秒(STC90C52RC@12M)
131 不同的工作环境,需要调整此函数
132 当改用1T的MCU时,请调整此延时函数
133 **************************************/
134 void Delay5ms()
135 {
136 WORD n = 560;
137
138 while (n--);
139 }
140
141 /**************************************
142 起始信号
143 **************************************/
144 void BH1750_Start()
145 {
146 SDA = 1; //拉高数据线
147 SCL = 1; //拉高时钟线
148 Delay5us(); //延时
149 SDA = 0; //产生下降沿
150 Delay5us(); //延时
151 SCL = 0; //拉低时钟线
152 }
153
154 /**************************************
155 停止信号
156 **************************************/
157 void BH1750_Stop()
158 {
159 SDA = 0; //拉低数据线
160 SCL = 1; //拉高时钟线
161 Delay5us(); //延时
162 SDA = 1; //产生上升沿
163 Delay5us(); //延时
164 }
165
166 /**************************************
167 发送应答信号
168 入口参数:ack (0:ACK 1:NAK)
169 **************************************/
170 void BH1750_SendACK(bit ack)
171 {
172 SDA = ack; //写应答信号
173 SCL = 1; //拉高时钟线
C51 COMPILER V9.56.0.0 LIGHT 04/30/2022 20:06:41 PAGE 4
174 Delay5us(); //延时
175 SCL = 0; //拉低时钟线
176 Delay5us(); //延时
177 }
178
179 /**************************************
180 接收应答信号
181 **************************************/
182 bit BH1750_RecvACK()
183 {
184 SCL = 1; //拉高时钟线
185 Delay5us(); //延时
186 CY = SDA; //读应答信号
187 SCL = 0; //拉低时钟线
188 Delay5us(); //延时
189
190 return CY;
191 }
192
193 /**************************************
194 向IIC总线发送一个字节数据
195 **************************************/
196 void BH1750_Sendunsigned char(unsigned char dat)
197 {
198 unsigned char i;
199
200 for (i=0; i<8; i++) //8位计数器
201 {
202 dat <<= 1; //移出数据的最高位
203 SDA = CY; //送数据口
204 SCL = 1; //拉高时钟线
205 Delay5us(); //延时
206 SCL = 0; //拉低时钟线
207 Delay5us(); //延时
208 }
209 BH1750_RecvACK();
210 }
211
212 /**************************************
213 从IIC总线接收一个字节数据
214 **************************************/
215 unsigned char BH1750_Recvunsigned char()
216 {
217 unsigned char i;
218 unsigned char dat = 0;
219
220 SDA = 1; //使能内部上拉,准备读取数据,
221 for (i=0; i<8; i++) //8位计数器
222 {
223 dat <<= 1;
224 SCL = 1; //拉高时钟线
225 Delay5us(); //延时
226 dat |= SDA; //读数据
227 SCL = 0; //拉低时钟线
228 Delay5us(); //延时
229 }
230 return dat;
231 }
232
233 //*********************************
234
235 void Single_Write_BH1750(uchar REG_Address)
C51 COMPILER V9.56.0.0 LIGHT 04/30/2022 20:06:41 PAGE 5
236 {
237 BH1750_Start(); //起始信号
238 BH1750_Sendunsigned char(SlaveAddress); //发送设备地址+写信号
239 BH1750_Sendunsigned char(REG_Address); //内部寄存器地址,
240 // BH1750_Sendunsigned char(REG_data); //内部寄存器数据,
241 BH1750_Stop(); //发送停止信号
242 }
243
244 //********单字节读取*****************************************
245 /*
246 uchar Single_Read_BH1750(uchar REG_Address)
247 { uchar REG_data;
248 BH1750_Start(); //起始信号
249 BH1750_Sendunsigned char(SlaveAddress); //发送设备地址+写信号
250 BH1750_Sendunsigned char(REG_Address); //发送存储单元地址,从0开始
251 BH1750_Start(); //起始信号
252 BH1750_Sendunsigned char(SlaveAddress+1); //发送设备地址+读信号
253 REG_data=BH1750_Recvunsigned char(); //读出寄存器数据
254 BH1750_SendACK(1);
255 BH1750_Stop(); //停止信号
256 return REG_data;
257 }
258 */
259 //*********************************************************
260 //
261 //连续读出BH1750内部数据
262 //
263 //*********************************************************
264 void Multiple_read_BH1750(void)
265
266 { uchar i;
267 BH1750_Start(); //起始信号
268 BH1750_Sendunsigned char(SlaveAddress+1); //发送设备地址+读信号
269
270 for (i=0; i<3; i++) //连续读取2个地址数据,存储中BUF
271 {
272 BUF[i] = BH1750_Recvunsigned char(); //BUF[0]存储0x32地址中的数据
273 if (i == 3)
274 {
275
276 BH1750_SendACK(1); //最后一个数据需要回NOACK
277 }
278 else
279 {
280 BH1750_SendACK(0); //回应ACK
281 }
282 }
283
284 BH1750_Stop(); //停止信号
285 Delay5ms();
286 }
287
288
289 //初始化BH1750,根据需要请参考pdf进行修改****
290 void Init_BH1750()
291 {
292 Single_Write_BH1750(0x01);
293
294 }
295
296
297 #endif
C51 COMPILER V9.56.0.0 LIGHT 04/30/2022 20:06:41 PAGE 6
C51 COMPILATION COMPLETE. 0 WARNING(S), 6 ERROR(S)

1
Light.__i

@ -0,0 +1 @@ @@ -0,0 +1 @@
"Light.c" OPTIMIZE (8,SPEED) BROWSE DEBUG OBJECTEXTEND TABS (2)

297
Light.c

@ -0,0 +1,297 @@ @@ -0,0 +1,297 @@
#ifndef __LIGHT_H_
#define __LIGHT_H_
#include <REG51.H>
#include <math.h> //Keil library
#include <stdio.h> //Keil library
#define SlaveAddress 0x46 //定义器件在IIC总线中的从地址,根据ALT ADDRESS地址引脚不同修改
//ALT ADDRESS引脚接地时地址为0x46,接电源时地址为0xB8
sbit SCL=P1^0; //IIC时钟引脚定义
sbit SDA=P1^1; //IIC数据引脚定义
typedef unsigned short WORD;
unsigned char BUF[8]; //接收数据缓存区
int dis_data; //变量
void delay_nms(unsigned int k);
void InitLcd();
void Init_BH1750(void);
void WriteDataLCM(uchar dataW);
void WriteCommandLCM(uchar CMD,uchar Attribc);
void DisplayOneChar(uchar X,uchar Y,uchar DData);
void conversion(uint temp_data);
void Single_Write_BH1750(uchar REG_Address); //单个写入数据
uchar Single_Read_BH1750(uchar REG_Address); //单个读取内部寄存器数据
void Multiple_Read_BH1750(); //连续的读取内部寄存器数据
//------------------------------------
void Delay5us();
void Delay5ms();
void BH1750_Start(); //起始信号
void BH1750_Stop(); //停止信号
void BH1750_SendACK(bit ack); //应答ACK
bit BH1750_RecvACK(); //读ack
void BH1750_Sendunsigned char(unsigned char dat); //IIC单个字节写
unsigned char BH1750_Recvunsigned char(); //IIC单个字节读
//-----------------------------------
//*********************************************************
void conversion(uint temp_data) // 数据转换出 个,十,百,千,万
{
wan=temp_data/10000+0x30 ;
temp_data=temp_data%10000; //取余运算
qian=temp_data/1000+0x30 ;
temp_data=temp_data%1000; //取余运算
bai=temp_data/100+0x30;
temp_data=temp_data%100; //取余运算
shi=temp_data/10+0x30;
temp_data=temp_data%10; //取余运算
ge=temp_data+0x30;
}
//毫秒延时**************************
void delay_nms(unsigned int k)
{
unsigned int i,j;
for(i=0;i<k;i++)
{
for(j=0;j<121;j++)
{;}}
}
/*******************************/
void WaitForEnable(void)
{
DataPort=0xff;
LCM_RS=0;LCM_RW=1;_nop_();
LCM_EN=1;_nop_();_nop_();
while(DataPort&0x80);
LCM_EN=0;
}
/*******************************/
void WriteCommandLCM(uchar CMD,uchar Attribc)
{
if(Attribc)WaitForEnable();
LCM_RS=0;LCM_RW=0;_nop_();
DataPort=CMD;_nop_();
LCM_EN=1;_nop_();_nop_();LCM_EN=0;
}
/*******************************/
void WriteDataLCM(uchar dataW)
{
WaitForEnable();
LCM_RS=1;LCM_RW=0;_nop_();
DataPort=dataW;_nop_();
LCM_EN=1;_nop_();_nop_();LCM_EN=0;
}
/***********************************/
void InitLcd()
{
WriteCommandLCM(0x38,1);
WriteCommandLCM(0x08,1);
WriteCommandLCM(0x01,1);
WriteCommandLCM(0x06,1);
WriteCommandLCM(0x0c,1);
}
/***********************************/
void DisplayOneChar(uchar X,uchar Y,uchar DData)
{
Y&=1;
X&=15;
if(Y)X|=0x40;
X|=0x80;
WriteCommandLCM(X,0);
WriteDataLCM(DData);
}
/**************************************
5(STC90C52RC@12M)
,
1T的MCU时,
**************************************/
void Delay5us()
{
_nop_();_nop_();_nop_();_nop_();
_nop_();_nop_();_nop_();_nop_();
_nop_();_nop_();_nop_();_nop_();
_nop_();_nop_();_nop_();_nop_();
}
/**************************************
5(STC90C52RC@12M)
,
1T的MCU时,
**************************************/
void Delay5ms()
{
WORD n = 560;
while (n--);
}
/**************************************
**************************************/
void BH1750_Start()
{
SDA = 1; //拉高数据线
SCL = 1; //拉高时钟线
Delay5us(); //延时
SDA = 0; //产生下降沿
Delay5us(); //延时
SCL = 0; //拉低时钟线
}
/**************************************
**************************************/
void BH1750_Stop()
{
SDA = 0; //拉低数据线
SCL = 1; //拉高时钟线
Delay5us(); //延时
SDA = 1; //产生上升沿
Delay5us(); //延时
}
/**************************************
:ack (0:ACK 1:NAK)
**************************************/
void BH1750_SendACK(bit ack)
{
SDA = ack; //写应答信号
SCL = 1; //拉高时钟线
Delay5us(); //延时
SCL = 0; //拉低时钟线
Delay5us(); //延时
}
/**************************************
**************************************/
bit BH1750_RecvACK()
{
SCL = 1; //拉高时钟线
Delay5us(); //延时
CY = SDA; //读应答信号
SCL = 0; //拉低时钟线
Delay5us(); //延时
return CY;
}
/**************************************
IIC总线发送一个字节数据
**************************************/
void BH1750_Sendunsigned char(unsigned char dat)
{
unsigned char i;
for (i=0; i<8; i++) //8位计数器
{
dat <<= 1; //移出数据的最高位
SDA = CY; //送数据口
SCL = 1; //拉高时钟线
Delay5us(); //延时
SCL = 0; //拉低时钟线
Delay5us(); //延时
}
BH1750_RecvACK();
}
/**************************************
IIC总线接收一个字节数据
**************************************/
unsigned char BH1750_Recvunsigned char()
{
unsigned char i;
unsigned char dat = 0;
SDA = 1; //使能内部上拉,准备读取数据,
for (i=0; i<8; i++) //8位计数器
{
dat <<= 1;
SCL = 1; //拉高时钟线
Delay5us(); //延时
dat |= SDA; //读数据
SCL = 0; //拉低时钟线
Delay5us(); //延时
}
return dat;
}
//*********************************
void Single_Write_BH1750(uchar REG_Address)
{
BH1750_Start(); //起始信号
BH1750_Sendunsigned char(SlaveAddress); //发送设备地址+写信号
BH1750_Sendunsigned char(REG_Address); //内部寄存器地址,
// BH1750_Sendunsigned char(REG_data); //内部寄存器数据,
BH1750_Stop(); //发送停止信号
}
//********单字节读取*****************************************
/*
uchar Single_Read_BH1750(uchar REG_Address)
{ uchar REG_data;
BH1750_Start(); //起始信号
BH1750_Sendunsigned char(SlaveAddress); //发送设备地址+写信号
BH1750_Sendunsigned char(REG_Address); //发送存储单元地址,从0开始
BH1750_Start(); //起始信号
BH1750_Sendunsigned char(SlaveAddress+1); //发送设备地址+读信号
REG_data=BH1750_Recvunsigned char(); //读出寄存器数据
BH1750_SendACK(1);
BH1750_Stop(); //停止信号
return REG_data;
}
*/
//*********************************************************
//
//连续读出BH1750内部数据
//
//*********************************************************
void Multiple_read_BH1750(void)
{ uchar i;
BH1750_Start(); //起始信号
BH1750_Sendunsigned char(SlaveAddress+1); //发送设备地址+读信号
for (i=0; i<3; i++) //连续读取2个地址数据,存储中BUF
{
BUF[i] = BH1750_Recvunsigned char(); //BUF[0]存储0x32地址中的数据
if (i == 3)
{
BH1750_SendACK(1); //最后一个数据需要回NOACK
}
else
{
BH1750_SendACK(0); //回应ACK
}
}
BH1750_Stop(); //停止信号
Delay5ms();
}
//初始化BH1750,根据需要请参考pdf进行修改****
void Init_BH1750()
{
Single_Write_BH1750(0x01);
}
#endif

12
ds1302.LST

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
C51 COMPILER V9.56.0.0 DS1302 04/28/2022 23:43:37 PAGE 1
C51 COMPILER V9.56.0.0 DS1302 05/01/2022 12:24:18 PAGE 1
C51 COMPILER V9.56.0.0, COMPILATION OF MODULE DS1302
@ -17,7 +17,7 @@ line level source @@ -17,7 +17,7 @@ line level source
8 //---DS1302时钟初始化2013年1月1日星期二12点00分00秒。---//
9 //---存储顺序是秒分时日月周年,存储格式是用BCD码---//
10
11 uchar TIME[7] = {0X00, 0X01, 0x23, 0x28, 0x04, 0x04, 0x22};
11 uchar TIME[7] = {0X00, 0X24, 0x12, 0x01, 0x05, 0x07, 0x22};
12
13
14 void Ds1302Write(uchar addr, uchar dat)
@ -62,7 +62,7 @@ line level source @@ -62,7 +62,7 @@ line level source
53 1
54 1 SCLK = 0;//先将SCLK置低电平。
55 1 _nop_();
C51 COMPILER V9.56.0.0 DS1302 04/28/2022 23:43:37 PAGE 2
C51 COMPILER V9.56.0.0 DS1302 05/01/2022 12:24:18 PAGE 2
56 1 RST = 1;//然后将RST(CE)置高电平。
57 1 _nop_();
@ -104,7 +104,7 @@ line level source @@ -104,7 +104,7 @@ line level source
93 1 Ds1302Write(0x8E,0X00); //禁止写保护,就是关闭写保护功能
94 1 for (n=0; n<7; n++)//写入7个字节的时钟信号:分秒时日月周年
95 1 {
96 2 Ds1302Write(WRITE_RTC_ADDR[n],TIME[n]);
96 2 //Ds1302Write(WRITE_RTC_ADDR[n],TIME[n]);
97 2 }
98 1 Ds1302Write(0x8E,0x80); //打开写保护功能
99 1 }
@ -122,11 +122,11 @@ line level source @@ -122,11 +122,11 @@ line level source
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 184 ----
CODE SIZE = 169 ----
CONSTANT SIZE = 14 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
C51 COMPILER V9.56.0.0 DS1302 04/28/2022 23:43:37 PAGE 3
C51 COMPILER V9.56.0.0 DS1302 05/01/2022 12:24:18 PAGE 3
DATA SIZE = 7 ----
IDATA SIZE = ---- ----

BIN
ds1302.OBJ

Binary file not shown.

4
ds1302.c

@ -8,7 +8,7 @@ uchar code WRITE_RTC_ADDR[7] = {0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c}; @@ -8,7 +8,7 @@ uchar code WRITE_RTC_ADDR[7] = {0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c};
//---DS1302时钟初始化2013年1月1日星期二12点00分00秒。---//
//---存储顺序是秒分时日月周年,存储格式是用BCD码---//
uchar TIME[7] = {0X00, 0X01, 0x23, 0x28, 0x04, 0x04, 0x22};
uchar TIME[7] = {0X00, 0X24, 0x12, 0x01, 0x05, 0x07, 0x22};
void Ds1302Write(uchar addr, uchar dat)
@ -93,7 +93,7 @@ void Ds1302Init() @@ -93,7 +93,7 @@ void Ds1302Init()
Ds1302Write(0x8E,0X00); //禁止写保护,就是关闭写保护功能
for (n=0; n<7; n++)//写入7个字节的时钟信号:分秒时日月周年
{
Ds1302Write(WRITE_RTC_ADDR[n],TIME[n]);
//Ds1302Write(WRITE_RTC_ADDR[n],TIME[n]);
}
Ds1302Write(0x8E,0x80); //打开写保护功能
}

6
lcd.LST

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
C51 COMPILER V9.56.0.0 LCD 04/29/2022 00:07:44 PAGE 1
C51 COMPILER V9.56.0.0 LCD 04/30/2022 18:10:32 PAGE 1
C51 COMPILER V9.56.0.0, COMPILATION OF MODULE LCD
@ -62,7 +62,7 @@ line level source @@ -62,7 +62,7 @@ line level source
LCD1602_E = 1; //写入时序
Lcd1602_Delay1ms(5);
C51 COMPILER V9.56.0.0 LCD 04/29/2022 00:07:44 PAGE 2
C51 COMPILER V9.56.0.0 LCD 04/30/2022 18:10:32 PAGE 2
LCD1602_E = 0;
@ -126,7 +126,7 @@ line level source @@ -126,7 +126,7 @@ line level source
115 #ifndef LCD1602_4PINS
116 void LcdInit() //LCD初始化子程序
117 {
C51 COMPILER V9.56.0.0 LCD 04/29/2022 00:07:44 PAGE 3
C51 COMPILER V9.56.0.0 LCD 04/30/2022 18:10:32 PAGE 3
118 1 LcdWriteCom(0x38); //开显示
119 1 LcdWriteCom(0x0c); //开显示不显示光标

BIN
lcd.OBJ

Binary file not shown.

2
lcd.h

@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
/**********************************
PIN¿Ú¨Òå
**********************************/
#define LCD1602_DATAPINS P2
#define LCD1602_DATAPINS P0
sbit LCD1602_E=P1^4;
sbit LCD1602_RW=P1^5;
sbit LCD1602_RS=P1^6;

769
main.LST

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
C51 COMPILER V9.56.0.0 MAIN 04/29/2022 01:22:41 PAGE 1
C51 COMPILER V9.56.0.0 MAIN 05/01/2022 12:19:19 PAGE 1
C51 COMPILER V9.56.0.0, COMPILATION OF MODULE MAIN
@ -11,198 +11,603 @@ line level source @@ -11,198 +11,603 @@ line level source
2 #include"lcd.h"
3 #include"ds1302.h"
4 #include"i2c.h"
5 #include <stdio.h>
6 #include <string.h>
7
8 sbit LED0=P0^2;
9 sbit LED1=P0^1;
10 sbit LED2=P0^0;
11 sbit LED3=P0^4;
12
13 sbit LED4=P0^3;
14
15 sbit key1 = P1^2;
16 sbit key2 = P1^3;
5 #include "DS18B20.h"
6
7 #include <stdio.h>
8 #include <string.h>
9
10
11 #define uchar unsigned char
12 #define uint unsigned int
13
14 sbit LED0=P2^5;
15 sbit LED1=P2^6;
16 sbit LED2=P2^1;
17
18 sbit IN = P3^7;
19 sbit OUT = P3^6;
20
21 struct UserInfo{
22 int num;
23 int model;
24 int start;
25 int Light;
26 };
18 sbit LED3=P2^4;
19
20 sbit LED4=P2^3;
21
22 sbit key1 = P1^2;
23 sbit key2 = P1^3;
24 sbit key3 = P2^2;
25 sbit key4 = P2^7;
26
27
28 struct UserInfo userInfo;
29
30 void LcdDisplay();
31 void LcdDisplay1();
32 void Delay10ms(void);
28 sbit IN = P3^7;
29 sbit OUT = P3^6;
30
31 sbit SCL1=P1^1;
32 sbit SDA1=P1^0;
33
34 void Uart_Init()
35 {
36 1 TMOD = 0x20 | 0x01;
37 1 SCON = 0x50;
38 1 TH1 = 0xFD;
39 1 TL1 = TH1;
40 1 PCON = 0x00;
41 1 EA = 1;
42 1 ES = 1;
43 1 TR1 = 1;
44 1 }
45
46 void us_delay(uchar t)
47 {
48 1 while(t--);
49 1 }
50
51 void Send_Uart(uchar value)
52 {
53 1 ES=0;
54 1 TI=0;
55 1 SBUF=value;
C51 COMPILER V9.56.0.0 MAIN 04/29/2022 01:22:41 PAGE 2
56 1 while(TI==0);
57 1 TI=0;
58 1 ES=1;
59 1 }
60
61 void Bluetooth_Set(uchar *puf)
62 {
63 1 while(*puf!='\0')
64 1 {
65 2 Send_Uart(*puf);
66 2 us_delay(5);
67 2 puf++;
68 2 }
69 1 }
70
71 void Detection()
72 {
73 1 int i = 0;
74 1 if(key1==0) //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>K1<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>
75 1 {
76 2 Delay10ms(); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
77 2 if(key1==0){
78 3 if(userInfo.model == 0) userInfo.model = 1;
79 3 else userInfo.model = 0;
80 3 }
81 2 while((i<50)&&(key1==0)){
82 3 Delay10ms();
83 3 i++;
84 3 }
85 2 i=0;
86 2 }
87 1
88 1 if(key2==0) //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>K1<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>
89 1 {
90 2 Delay10ms(); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
91 2 if(key2==0){
92 3 if(userInfo.start == 0) userInfo.start = 1;
93 3 else userInfo.start = 0;
94 3 }
95 2 while((i<50)&&(key2==0)){
96 3 Delay10ms();
97 3 i++;
98 3 }
99 2 i=0;
100 2 }
101 1
102 1 if(IN==0) //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>K1<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>
103 1 {
104 2 Delay10ms(); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
105 2 if(IN==0){
106 3 userInfo.num++;
107 3 if(userInfo.num > 99) userInfo.num = 99;
108 3 }
109 2 while((i<50)&&(IN==0)){
110 3 Delay10ms();
111 3 i++;
112 3 }
113 2 i=0;
114 2 }
115 1
116 1 if(OUT==0) //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>K1<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>
117 1 {
C51 COMPILER V9.56.0.0 MAIN 04/29/2022 01:22:41 PAGE 3
118 2 Delay10ms(); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
119 2 if(OUT==0){
120 3 userInfo.num--;
121 3 if(userInfo.num < 0) userInfo.num = 0;
122 3 }
123 2 while((i<50)&&(OUT==0)){
124 3 Delay10ms();
125 3 i++;
126 3 }
127 2 i=0;
128 2 }
129 1 }
130
131 void Dispose()
132 {
133 1 if(userInfo.start && userInfo.model){
134 2 LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 0;
135 2 }else{
136 2 if(userInfo.Light < 50 && userInfo.model == 0){
137 3 if(userInfo.num < 10 && userInfo.num > 0) LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 1;
138 3 else if(userInfo.num >= 10 && userInfo.num < 20) LED0 = 0, LED1 = 0, LED2 = 1 ,LED3 = 1;
139 3 else if(userInfo.num >= 20 && userInfo.num < 30) LED0 = 0, LED1 = 1, LED2 = 1 ,LED3 = 1;
140 3 else if(userInfo.num >= 30) LED0 = 1, LED1 = 1, LED2 = 1 ,LED3 = 1;
141 3 else LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 0;
142 3 }
143 2 }
144 1 LED4 = userInfo.model;
145 1 }
146
147 void main()
148 {
149 1 int i = 0;
150 1 uchar str[30];
151 1 LcdInit();
152 1 Ds1302Init();
153 1 Uart_Init();
154 1 while(1)
155 1 {
156 2 Ds1302ReadTime();
157 2 LcdDisplay();
158 2 Detection();
159 2 sprintf(str, "%d\r\n", userInfo.model);
160 2 Bluetooth_Set(str);
161 2 Dispose();
162 2 }
163 1 }
164
34 int cut = 0;
35
36 struct Time{
37 int hour;
38 int min;
39 int sec;
40 };
41
42 struct UserInfo{
43 int num;
44 int model;
45 int set;
46 int start;
47 float Light;
48 int temp;
49 struct Time time[2];
50 };
51
52 struct UserInfo userInfo;
53
54 void LcdDisplay();
55 void LcdDisplay1();
C51 COMPILER V9.56.0.0 MAIN 05/01/2022 12:19:19 PAGE 2
56 void Delay10ms(void);
57
58 #define SlaveAddress 0x46 //¶¨ÒåÆ÷¼þÔÚIIC×ÜÏßÖеĴӵØÖ·,¸ù¾ÝALT ADDRESSµ
-ØÖ·Òý½Å²»Í¬ÐÞ¸Ä
59 //ALT ADDRESSÒý½Å½ÓµØʱµØַΪ0x46£¬½ÓµçԴʱµØÖ
-·Îª0xB8
60 typedef unsigned char BYTE;
61 typedef unsigned short WORD;
62
63 BYTE BUF[8]; //½ÓÊÕÊý¾Ý»º´æÇø
64 int dis_data; //±äÁ¿
65
66 void delay_nms(unsigned int k);
67 void InitLcd();
68 void Init_BH1750(void);
69
70 void WriteDataLCM(uchar dataW);
71 void WriteCommandLCM(uchar CMD,uchar Attribc);
72 void DisplayOneChar(uchar X,uchar Y,uchar DData);
73 void conversion(uint temp_data);
74
75 void Single_Write_BH1750(uchar REG_Address); //µ¥¸öдÈëÊý¾Ý
76 uchar Single_Read_BH1750(uchar REG_Address); //µ¥¸ö¶ÁÈ¡ÄÚ²¿¼Ä´æÆ÷Êý¾Ý
77 void Multiple_Read_BH1750(); //Á¬ÐøµÄ¶ÁÈ¡ÄÚ²¿¼Ä´æÆ÷Êý
-¾Ý
78 //------------------------------------
79 void Delay5us();
80 void Delay5ms();
81 void BH1750_Start(); //ÆðʼÐźÅ
82 void BH1750_Stop(); //Í£Ö¹ÐźÅ
83 void BH1750_SendACK(bit ack); //Ó¦´ðACK
84 bit BH1750_RecvACK(); //¶Áack
85 void BH1750_SendByte(BYTE dat); //IICµ¥¸ö×Ö½Úд
86 BYTE BH1750_RecvByte(); //IICµ¥¸ö×Ö½Ú¶Á
87
88
89 //ºÁÃëÑÓʱ**************************
90 void delay_nms(unsigned int k)
91 {
92 1 unsigned int i,j;
93 1 for(i=0;i<k;i++)
94 1 {
95 2 for(j=0;j<121;j++)
96 2 {;}}
97 1 }
98
99 void Delay5us()
100 {
101 1 _nop_();_nop_();_nop_();_nop_();
102 1 _nop_();_nop_();_nop_();_nop_();
103 1 _nop_();_nop_();_nop_();_nop_();
104 1 _nop_();_nop_();_nop_();_nop_();
105 1 }
106
107 void Delay5ms()
108 {
109 1 WORD n = 560;
110 1
111 1 while (n--);
112 1 }
113
114 /**************************************
C51 COMPILER V9.56.0.0 MAIN 05/01/2022 12:19:19 PAGE 3
115 ÆðʼÐźÅ
116 **************************************/
117 void BH1750_Start()
118 {
119 1 SDA1 = 1; //À­¸ßÊý¾ÝÏß
120 1 SCL1 = 1; //À­¸ßʱÖÓÏß
121 1 Delay5us(); //ÑÓʱ
122 1 SDA1 = 0; //²úÉúϽµÑØ
123 1 Delay5us(); //ÑÓʱ
124 1 SCL1 = 0; //À­µÍʱÖÓÏß
125 1 }
126
127 /**************************************
128 Í£Ö¹ÐźÅ
129 **************************************/
130 void BH1750_Stop()
131 {
132 1 SDA1 = 0; //À­µÍÊý¾ÝÏß
133 1 SCL1 = 1; //À­¸ßʱÖÓÏß
134 1 Delay5us(); //ÑÓʱ
135 1 SDA1 = 1; //²úÉúÉÏÉýÑØ
136 1 Delay5us(); //ÑÓʱ
137 1 }
138
139 /**************************************
140 ·¢ËÍÓ¦´ðÐźÅ
141 Èë¿Ú²ÎÊý:ack (0:ACK 1:NAK)
142 **************************************/
143 void BH1750_SendACK(bit ack)
144 {
145 1 SDA1 = ack; //дӦ´ðÐźÅ
146 1 SCL1 = 1; //À­¸ßʱÖÓÏß
147 1 Delay5us(); //ÑÓʱ
148 1 SCL1 = 0; //À­µÍʱÖÓÏß
149 1 Delay5us(); //ÑÓʱ
150 1 }
151
152 /**************************************
153 ½ÓÊÕÓ¦´ðÐźÅ
154 **************************************/
155 bit BH1750_RecvACK()
156 {
157 1 SCL1 = 1; //À­¸ßʱÖÓÏß
158 1 Delay5us(); //ÑÓʱ
159 1 CY = SDA1; //¶ÁÓ¦´ðÐźÅ
160 1 SCL1 = 0; //À­µÍʱÖÓÏß
161 1 Delay5us(); //ÑÓʱ
162 1
163 1 return CY;
164 1 }
165
166 void LcdDisplay()
167 {
168 1 // TODO 显示时间
169 1 LcdWriteCom(0x80);
170 1 LcdWriteData('m');
171 1 }
172
173
174 void Delay10ms(void) //<EFBFBD><EFBFBD><EFBFBD> 0us
175 {
176 1 unsigned char a,b,c;
177 1 for(c=1;c>0;c--)
178 1 for(b=38;b>0;b--)
179 1 for(a=130;a>0;a--);
C51 COMPILER V9.56.0.0 MAIN 04/29/2022 01:22:41 PAGE 4
180 1 }
166 /**************************************
167 ÏòIIC×ÜÏß·¢ËÍÒ»¸ö×Ö½ÚÊý¾Ý
168 **************************************/
169 void BH1750_SendByte(BYTE dat)
170 {
171 1 BYTE i;
172 1
173 1 for (i=0; i<8; i++) //8λ¼ÆÊýÆ÷
174 1 {
175 2 dat <<= 1; //ÒƳöÊý¾ÝµÄ×î¸ßλ
176 2 SDA1 = CY; //ËÍÊý¾Ý¿Ú
C51 COMPILER V9.56.0.0 MAIN 05/01/2022 12:19:19 PAGE 4
177 2 SCL1 = 1; //À­¸ßʱÖÓÏß
178 2 Delay5us(); //ÑÓʱ
179 2 SCL1 = 0; //À­µÍʱÖÓÏß
180 2 Delay5us(); //ÑÓʱ
181 2 }
182 1 BH1750_RecvACK();
183 1 }
184
185 /**************************************
186 ´ÓIIC×ÜÏß½ÓÊÕÒ»¸ö×Ö½ÚÊý¾Ý
187 **************************************/
188 BYTE BH1750_RecvByte()
189 {
190 1 BYTE i;
191 1 BYTE dat = 0;
192 1
193 1 SDA1 = 1; //ʹÄÜÄÚ²¿ÉÏÀ­,×¼±¸¶ÁÈ¡Êý¾Ý,
194 1 for (i=0; i<8; i++) //8λ¼ÆÊýÆ÷
195 1 {
196 2 dat <<= 1;
197 2 SCL1 = 1; //À­¸ßʱÖÓÏß
198 2 Delay5us(); //ÑÓʱ
199 2 dat |= SDA1; //¶ÁÊý¾Ý
200 2 SCL1 = 0; //À­µÍʱÖÓÏß
201 2 Delay5us(); //ÑÓʱ
202 2 }
203 1 return dat;
204 1 }
205
206 //*********************************
207
208 void Single_Write_BH1750(uchar REG_Address)
209 {
210 1 BH1750_Start(); //ÆðʼÐźÅ
211 1 BH1750_SendByte(SlaveAddress); //·¢ËÍÉ豸µØÖ·+дÐźÅ
212 1 BH1750_SendByte(REG_Address); //ÄÚ²¿¼Ä´æÆ÷µØÖ·£¬
213 1 // BH1750_SendByte(REG_data); //ÄÚ²¿¼Ä´æÆ÷Êý¾Ý£¬
214 1 BH1750_Stop(); //·¢ËÍÍ£Ö¹ÐźÅ
215 1 }
216
217 //********µ¥×Ö½Ú¶ÁÈ¡*****************************************
218 /*
219 uchar Single_Read_BH1750(uchar REG_Address)
220 { uchar REG_data;
221 BH1750_Start(); //ÆðʼÐźÅ
222 BH1750_SendByte(SlaveAddress); //·¢ËÍÉ豸µØÖ·+дÐźÅ
223 BH1750_SendByte(REG_Address); //·¢ËÍ´æ´¢µ¥ÔªµØÖ·£¬´Ó0¿ªÊ¼
224 BH1750_Start(); //ÆðʼÐźÅ
225 BH1750_SendByte(SlaveAddress+1); //·¢ËÍÉ豸µØÖ·+¶ÁÐźÅ
226 REG_data=BH1750_RecvByte(); //¶Á³ö¼Ä´æÆ÷Êý¾Ý
227 BH1750_SendACK(1);
228 BH1750_Stop(); //Í£Ö¹ÐźÅ
229 return REG_data;
230 }
231 */
232 //*********************************************************
233 //
234 //Á¬Ðø¶Á³öBH1750ÄÚ²¿Êý¾Ý
235 //
236 //*********************************************************
237 void Multiple_read_BH1750(void)
238
C51 COMPILER V9.56.0.0 MAIN 05/01/2022 12:19:19 PAGE 5
239 { uchar i;
240 1 BH1750_Start(); //ÆðʼÐźÅ
241 1 BH1750_SendByte(SlaveAddress+1); //·¢ËÍÉ豸µØÖ·+¶ÁÐźÅ
242 1
243 1 for (i=0; i<3; i++) //Á¬Ðø¶ÁÈ¡2¸öµØÖ·Êý¾Ý£¬´æ´¢ÖÐBUF
244 1 {
245 2 BUF[i] = BH1750_RecvByte(); //BUF[0]´æ´¢0x32µØÖ·ÖеÄÊý¾Ý
246 2 if (i == 3)
247 2 {
248 3
249 3 BH1750_SendACK(1); //×îºóÒ»¸öÊý¾ÝÐèÒª»ØNOACK
250 3 }
251 2 else
252 2 {
253 3 BH1750_SendACK(0); //»ØÓ¦ACK
254 3 }
255 2 }
256 1
257 1 BH1750_Stop(); //Í£Ö¹ÐźÅ
258 1 Delay5ms();
259 1 }
260
261
262 //³õʼ»¯BH1750£¬¸ù¾ÝÐèÒªÇë²Î¿¼pdf½øÐÐÐÞ¸Ä****
263 void Init_BH1750()
264 {
265 1 Single_Write_BH1750(0x01);
266 1
267 1 }
268
269
270 void Uart_Init()
271 {
272 1 TMOD = 0x20 | 0x01;
273 1 SCON = 0x50;
274 1 TH1 = 0xFD;
275 1 TL1 = TH1;
276 1 PCON = 0x00;
277 1 EA = 1;
278 1 ES = 1;
279 1 TR1 = 1;
280 1 }
281
282 void us_delay(uchar t)
283 {
284 1 while(t--);
285 1 }
286
287 void Send_Uart(uchar value)
288 {
289 1 ES=0;
290 1 TI=0;
291 1 SBUF=value;
292 1 while(TI==0);
293 1 TI=0;
294 1 ES=1;
295 1 }
296
297 void Bluetooth_Set(uchar *puf)
298 {
299 1 while(*puf!='\0')
300 1 {
C51 COMPILER V9.56.0.0 MAIN 05/01/2022 12:19:19 PAGE 6
301 2 Send_Uart(*puf);
302 2 us_delay(5);
303 2 puf++;
304 2 }
305 1 }
306
307 void Detection()
308 {
309 1 int i = 0;
310 1 Single_Write_BH1750(0x01);
311 1 Single_Write_BH1750(0x10);
312 1 delay_nms(180);
313 1 Multiple_Read_BH1750();
314 1 dis_data=BUF[0];
315 1 dis_data=(dis_data<<8)+BUF[1];
316 1 userInfo.Light = (float)dis_data/1.2;
317 1
318 1 userInfo.temp = Temper_change();
319 1 userInfo.temp /= 100;
320 1 if(key1==0)
321 1 {
322 2 Delay10ms();
323 2 if(key1==0){
324 3 if(userInfo.set == 0){
325 4 if(userInfo.model == 0) userInfo.model = 1;
326 4 else userInfo.model = 0;
327 4 }
328 3 }
329 2 while((i<50)&&(key1==0)){
330 3 Delay10ms();
331 3 i++;
332 3 }
333 2 i=0;
334 2 }
335 1
336 1 if(key2==0)
337 1 {
338 2 Delay10ms();
339 2 if(key2==0){
340 3 if(userInfo.model){
341 4 if(userInfo.start == 0) userInfo.start = 1;
342 4 else userInfo.start = 0;
343 4 }else{
344 4 if(userInfo.set == 0) userInfo.set = 1;
345 4 else userInfo.set = 0;
346 4 cut = 0;
347 4 }
348 3 LcdWriteCom(0x01); //清屏
349 3 }
350 2 while((i<50)&&(key2==0)){
351 3 Delay10ms();
352 3 i++;
353 3 }
354 2 i=0;
355 2 }
356 1
357 1 if(IN==0)
358 1 {
359 2 Delay10ms();
360 2 if(IN==0){
361 3 userInfo.num++;
362 3 if(userInfo.num > 99) userInfo.num = 99;
C51 COMPILER V9.56.0.0 MAIN 05/01/2022 12:19:19 PAGE 7
363 3 }
364 2 while((i<50)&&(IN==0)){
365 3 Delay10ms();
366 3 i++;
367 3 }
368 2 i=0;
369 2 }
370 1
371 1 if(OUT==0) //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>K1<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>
372 1 {
373 2 Delay10ms(); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
374 2 if(OUT==0){
375 3 userInfo.num--;
376 3 if(userInfo.num < 0) userInfo.num = 0;
377 3 }
378 2 while((i<50)&&(OUT==0)){
379 3 Delay10ms();
380 3 i++;
381 3 }
382 2 i=0;
383 2 }
384 1
385 1 if(key3==0) //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>K1<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>
386 1 {
387 2 Delay10ms(); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
388 2 if(key3==0){
389 3 cut++;
390 3 if(cut >= 4) cut = 0;
391 3 }
392 2 while((i<50)&&(key3==0)){
393 3 Delay10ms();
394 3 i++;
395 3 }
396 2 i=0;
397 2 }
398 1
399 1 if(key4==0) //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>K1<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>
400 1 {
401 2 Delay10ms(); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
402 2 if(key4==0){
403 3 if(cut == 0){
404 4 userInfo.time[0].hour++;
405 4 if(userInfo.time[0].hour >= 24) userInfo.time[0].hour = 0;
406 4 }else if(cut == 1){
407 4 userInfo.time[0].min++;
408 4 if(userInfo.time[0].min >= 59) userInfo.time[0].min = 0;
409 4 }else if(cut == 2){
410 4 userInfo.time[1].hour++;
411 4 if(userInfo.time[1].hour >= 24) userInfo.time[1].hour = 0;
412 4 }else if(cut == 3){
413 4 userInfo.time[1].min++;
414 4 if(userInfo.time[1].min >= 59) userInfo.time[1].min = 0;
415 4 }
416 3 while((i<50)&&(key4==0)){
417 4 Delay10ms();
418 4 i++;
419 4 }
420 3 i=0;
421 3 }
422 2 }
423 1 }
424
C51 COMPILER V9.56.0.0 MAIN 05/01/2022 12:19:19 PAGE 8
425
426 int getTimeResult()
427 {
428 1 int result = 1;
429 1 struct Time Nowtime;
430 1
431 1 Nowtime.hour = TIME[2]/16 * 10 + (TIME[2]&0x0f);
432 1 Nowtime.min = TIME[1]/16 * 10 + (TIME[1]&0x0f);
433 1
434 1 if(Nowtime.hour < userInfo.time[0].hour || Nowtime.hour > userInfo.time[1].hour) return 0;
435 1 if(Nowtime.hour == userInfo.time[0].hour && Nowtime.min < userInfo.time[0].min) return 0;
436 1 if(Nowtime.hour == userInfo.time[1].hour && Nowtime.min > userInfo.time[1].min) return 0;
437 1
438 1 return result;
439 1 }
440
441
442 void Dispose()
443 {
444 1
445 1 if(userInfo.model == 0){
446 2 if(getTimeResult() && userInfo.Light < 100){
447 3 if(userInfo.num < 10 && userInfo.num > 0) LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 1;
448 3 else if(userInfo.num >= 10 && userInfo.num < 20) LED0 = 0, LED1 = 0, LED2 = 1 ,LED3 = 1;
449 3 else if(userInfo.num >= 20 && userInfo.num < 30) LED0 = 0, LED1 = 1, LED2 = 1 ,LED3 = 1;
450 3 else if(userInfo.num >= 30) LED0 = 1, LED1 = 1, LED2 = 1 ,LED3 = 1;
451 3 else LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 0;
452 3 }else{
453 3 LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 0;
454 3 }
455 2 }else{
456 2 if(userInfo.start){
457 3 LED0 = 1, LED1 = 1, LED2 = 1 ,LED3 = 1;
458 3 }else{
459 3 LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 0;
460 3 }
461 2 }
462 1 LED4 = userInfo.model;
463 1 }
464
465 void main()
466 {
467 1 int i = 0;
468 1 uchar str[10];
469 1 Ds1302Init();
470 1 Uart_Init();
471 1 LcdInit();
472 1
473 1 userInfo.time[0].hour = 18;
474 1 userInfo.time[0].min = 0;
475 1 userInfo.time[0].sec = 0;
476 1
477 1 userInfo.time[1].hour = 23;
478 1 userInfo.time[1].min = 30;
479 1 userInfo.time[1].sec = 0;
480 1
481 1 while(1)
482 1 {
483 2 Ds1302ReadTime();
484 2 LcdDisplay();
485 2 Detection();
486 2 Dispose();
C51 COMPILER V9.56.0.0 MAIN 05/01/2022 12:19:19 PAGE 9
487 2 sprintf(str, "%d\r\n", userInfo.temp);
488 2 Bluetooth_Set(str);
489 2 }
490 1 }
491
492 void LcdDisplay()
493 {
494 1 uint temp_data;
495 1 if(userInfo.set == 0){
496 2 // TODO 显示时间
497 2 LcdWriteCom(0x80);
498 2 LcdWriteData('0'+TIME[4]/16); //月
499 2 LcdWriteData('0'+(TIME[4]&0x0f));
500 2 LcdWriteData('-');
501 2 LcdWriteData('0'+TIME[3]/16); //日
502 2 LcdWriteData('0'+(TIME[3]&0x0f));
503 2 LcdWriteData(' ');
504 2
505 2 LcdWriteData('0'+TIME[2]/16); //时
506 2 LcdWriteData('0'+(TIME[2]&0x0f));
507 2 LcdWriteData(':');
508 2 LcdWriteData('0'+TIME[1]/16); //分
509 2 LcdWriteData('0'+(TIME[1]&0x0f));
510 2 LcdWriteData(':');
511 2 LcdWriteData('0'+TIME[0]/16); //秒
512 2 LcdWriteData('0'+(TIME[0]&0x0f));
513 2
514 2 LcdWriteData(' ');
515 2 LcdWriteData('0'+(TIME[5]&0x0f));
516 2
517 2 LcdWriteCom(0x80 + 0x40);
518 2 temp_data = userInfo.Light;
519 2 temp_data=temp_data%10000;
520 2 LcdWriteData(temp_data/1000+0x30);
521 2 temp_data=temp_data%1000;
522 2 LcdWriteData(temp_data/100+0x30);
523 2 temp_data=temp_data%100;
524 2 LcdWriteData(temp_data/10+0x30);
525 2 temp_data=temp_data%10;
526 2 LcdWriteData(temp_data+0x30);
527 2 LcdWriteData('L');
528 2 LcdWriteData('x');
529 2 LcdWriteData(' ');
530 2 LcdWriteData(userInfo.temp / 10 + 0x30);
531 2 LcdWriteData(userInfo.temp % 10 + 0x30);
532 2 LcdWriteData('C');
533 2
534 2 LcdWriteData(' ');
535 2 LcdWriteData(userInfo.num / 10 % 10 + 0x30);
536 2 LcdWriteData(userInfo.num % 10 + 0x30);
537 2 }else{
538 2 LcdWriteCom(0x80);
539 2 LcdWriteData('0'+ userInfo.time[0].hour/10); //时
540 2 LcdWriteData('0'+ userInfo.time[0].hour% 10);
541 2 LcdWriteData(':');
542 2 LcdWriteData('0'+userInfo.time[0].min/10); //分
543 2 LcdWriteData('0'+ userInfo.time[0].min % 10);
544 2 LcdWriteData(':');
545 2 LcdWriteData('0'+userInfo.time[0].sec / 10); //秒
546 2 LcdWriteData('0'+userInfo.time[0].sec % 10);
547 2 LcdWriteData(' ');
548 2
C51 COMPILER V9.56.0.0 MAIN 05/01/2022 12:19:19 PAGE 10
549 2 LcdWriteData('0'+cut);
550 2
551 2 LcdWriteCom(0x80 + 0x40);
552 2 LcdWriteData('0'+ userInfo.time[1].hour/10); //时
553 2 LcdWriteData('0'+ userInfo.time[1].hour% 10);
554 2 LcdWriteData(':');
555 2 LcdWriteData('0'+userInfo.time[1].min/10); //分
556 2 LcdWriteData('0'+ userInfo.time[1].min % 10);
557 2 LcdWriteData(':');
558 2 LcdWriteData('0'+userInfo.time[1].sec / 10); //秒
559 2 LcdWriteData('0'+userInfo.time[1].sec % 10);
560 2 }
561 1 }
562
563
564 void Delay10ms(void) //<EFBFBD><EFBFBD><EFBFBD> 0us
565 {
566 1 unsigned char a,b,c;
567 1 for(c=1;c>0;c--)
568 1 for(b=38;b>0;b--)
569 1 for(a=130;a>0;a--);
570 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 589 ----
CODE SIZE = 2027 ----
CONSTANT SIZE = 5 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 8 34
DATA SIZE = 38 22
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
BIT SIZE = ---- 1
END OF MODULE INFORMATION.

BIN
main.OBJ

Binary file not shown.

446
main.c

@ -2,27 +2,51 @@ @@ -2,27 +2,51 @@
#include"lcd.h"
#include"ds1302.h"
#include"i2c.h"
#include "DS18B20.h"
#include <stdio.h>
#include <string.h>
sbit LED0=P0^2;
sbit LED1=P0^1;
sbit LED2=P0^0;
sbit LED3=P0^4;
sbit LED4=P0^3;
#define uchar unsigned char
#define uint unsigned int
sbit LED0=P2^5;
sbit LED1=P2^6;
sbit LED2=P2^1;
sbit LED3=P2^4;
sbit LED4=P2^3;
sbit key1 = P1^2;
sbit key2 = P1^3;
sbit key3 = P2^2;
sbit key4 = P2^7;
sbit IN = P3^7;
sbit OUT = P3^6;
sbit SCL1=P1^1;
sbit SDA1=P1^0;
int cut = 0;
struct Time{
int hour;
int min;
int sec;
};
struct UserInfo{
int num;
int model;
int set;
int start;
int Light;
float Light;
int temp;
struct Time time[2];
};
struct UserInfo userInfo;
@ -31,6 +55,218 @@ void LcdDisplay(); @@ -31,6 +55,218 @@ void LcdDisplay();
void LcdDisplay1();
void Delay10ms(void);
#define SlaveAddress 0x46 //¶¨ÒåÆ÷¼þÔÚIIC×ÜÏßÖеĴӵØÖ·,¸ù¾ÝALT ADDRESSµØÖ·Òý½Å²»Í¬ÐÞ¸Ä
//ALT ADDRESSÒý½Å½ÓµØʱµØַΪ0x46£¬½ÓµçԴʱµØַΪ0xB8
typedef unsigned char BYTE;
typedef unsigned short WORD;
BYTE BUF[8]; //½ÓÊÕÊý¾Ý»º´æÇø
int dis_data; //±äÁ¿
void delay_nms(unsigned int k);
void InitLcd();
void Init_BH1750(void);
void WriteDataLCM(uchar dataW);
void WriteCommandLCM(uchar CMD,uchar Attribc);
void DisplayOneChar(uchar X,uchar Y,uchar DData);
void conversion(uint temp_data);
void Single_Write_BH1750(uchar REG_Address); //µ¥¸öдÈëÊý¾Ý
uchar Single_Read_BH1750(uchar REG_Address); //µ¥¸ö¶ÁÈ¡ÄÚ²¿¼Ä´æÆ÷Êý¾Ý
void Multiple_Read_BH1750(); //Á¬ÐøµÄ¶ÁÈ¡ÄÚ²¿¼Ä´æÆ÷Êý¾Ý
//------------------------------------
void Delay5us();
void Delay5ms();
void BH1750_Start(); //ÆðʼÐźÅ
void BH1750_Stop(); //Í£Ö¹ÐźÅ
void BH1750_SendACK(bit ack); //Ó¦´ðACK
bit BH1750_RecvACK(); //¶Áack
void BH1750_SendByte(BYTE dat); //IICµ¥¸ö×Ö½Úд
BYTE BH1750_RecvByte(); //IICµ¥¸ö×Ö½Ú¶Á
//ºÁÃëÑÓʱ**************************
void delay_nms(unsigned int k)
{
unsigned int i,j;
for(i=0;i<k;i++)
{
for(j=0;j<121;j++)
{;}}
}
void Delay5us()
{
_nop_();_nop_();_nop_();_nop_();
_nop_();_nop_();_nop_();_nop_();
_nop_();_nop_();_nop_();_nop_();
_nop_();_nop_();_nop_();_nop_();
}
void Delay5ms()
{
WORD n = 560;
while (n--);
}
/**************************************
ÆðʼÐźÅ
**************************************/
void BH1750_Start()
{
SDA1 = 1; //À­¸ßÊý¾ÝÏß
SCL1 = 1; //À­¸ßʱÖÓÏß
Delay5us(); //ÑÓʱ
SDA1 = 0; //²úÉúϽµÑØ
Delay5us(); //ÑÓʱ
SCL1 = 0; //À­µÍʱÖÓÏß
}
/**************************************
Í£Ö¹ÐźÅ
**************************************/
void BH1750_Stop()
{
SDA1 = 0; //À­µÍÊý¾ÝÏß
SCL1 = 1; //À­¸ßʱÖÓÏß
Delay5us(); //ÑÓʱ
SDA1 = 1; //²úÉúÉÏÉýÑØ
Delay5us(); //ÑÓʱ
}
/**************************************
·¢ËÍÓ¦´ðÐźÅ
Èë¿Ú²ÎÊý:ack (0:ACK 1:NAK)
**************************************/
void BH1750_SendACK(bit ack)
{
SDA1 = ack; //дӦ´ðÐźÅ
SCL1 = 1; //À­¸ßʱÖÓÏß
Delay5us(); //ÑÓʱ
SCL1 = 0; //À­µÍʱÖÓÏß
Delay5us(); //ÑÓʱ
}
/**************************************
½ÓÊÕÓ¦´ðÐźÅ
**************************************/
bit BH1750_RecvACK()
{
SCL1 = 1; //À­¸ßʱÖÓÏß
Delay5us(); //ÑÓʱ
CY = SDA1; //¶ÁÓ¦´ðÐźÅ
SCL1 = 0; //À­µÍʱÖÓÏß
Delay5us(); //ÑÓʱ
return CY;
}
/**************************************
ÏòIIC×ÜÏß·¢ËÍÒ»¸ö×Ö½ÚÊý¾Ý
**************************************/
void BH1750_SendByte(BYTE dat)
{
BYTE i;
for (i=0; i<8; i++) //8λ¼ÆÊýÆ÷
{
dat <<= 1; //ÒƳöÊý¾ÝµÄ×î¸ßλ
SDA1 = CY; //ËÍÊý¾Ý¿Ú
SCL1 = 1; //À­¸ßʱÖÓÏß
Delay5us(); //ÑÓʱ
SCL1 = 0; //À­µÍʱÖÓÏß
Delay5us(); //ÑÓʱ
}
BH1750_RecvACK();
}
/**************************************
´ÓIIC×ÜÏß½ÓÊÕÒ»¸ö×Ö½ÚÊý¾Ý
**************************************/
BYTE BH1750_RecvByte()
{
BYTE i;
BYTE dat = 0;
SDA1 = 1; //ʹÄÜÄÚ²¿ÉÏÀ­,×¼±¸¶ÁÈ¡Êý¾Ý,
for (i=0; i<8; i++) //8λ¼ÆÊýÆ÷
{
dat <<= 1;
SCL1 = 1; //À­¸ßʱÖÓÏß
Delay5us(); //ÑÓʱ
dat |= SDA1; //¶ÁÊý¾Ý
SCL1 = 0; //À­µÍʱÖÓÏß
Delay5us(); //ÑÓʱ
}
return dat;
}
//*********************************
void Single_Write_BH1750(uchar REG_Address)
{
BH1750_Start(); //ÆðʼÐźÅ
BH1750_SendByte(SlaveAddress); //·¢ËÍÉ豸µØÖ·+дÐźÅ
BH1750_SendByte(REG_Address); //ÄÚ²¿¼Ä´æÆ÷µØÖ·£¬
// BH1750_SendByte(REG_data); //ÄÚ²¿¼Ä´æÆ÷Êý¾Ý£¬
BH1750_Stop(); //·¢ËÍÍ£Ö¹ÐźÅ
}
//********µ¥×Ö½Ú¶ÁÈ¡*****************************************
/*
uchar Single_Read_BH1750(uchar REG_Address)
{ uchar REG_data;
BH1750_Start(); //ÆðʼÐźÅ
BH1750_SendByte(SlaveAddress); //·¢ËÍÉ豸µØÖ·+дÐźÅ
BH1750_SendByte(REG_Address); //·¢ËÍ´æ´¢µ¥ÔªµØÖ·£¬´Ó0¿ªÊ¼
BH1750_Start(); //ÆðʼÐźÅ
BH1750_SendByte(SlaveAddress+1); //·¢ËÍÉ豸µØÖ·+¶ÁÐźÅ
REG_data=BH1750_RecvByte(); //¶Á³ö¼Ä´æÆ÷Êý¾Ý
BH1750_SendACK(1);
BH1750_Stop(); //Í£Ö¹ÐźÅ
return REG_data;
}
*/
//*********************************************************
//
//Á¬Ðø¶Á³öBH1750ÄÚ²¿Êý¾Ý
//
//*********************************************************
void Multiple_read_BH1750(void)
{ uchar i;
BH1750_Start(); //ÆðʼÐźÅ
BH1750_SendByte(SlaveAddress+1); //·¢ËÍÉ豸µØÖ·+¶ÁÐźÅ
for (i=0; i<3; i++) //Á¬Ðø¶ÁÈ¡2¸öµØÖ·Êý¾Ý£¬´æ´¢ÖÐBUF
{
BUF[i] = BH1750_RecvByte(); //BUF[0]´æ´¢0x32µØÖ·ÖеÄÊý¾Ý
if (i == 3)
{
BH1750_SendACK(1); //×îºóÒ»¸öÊý¾ÝÐèÒª»ØNOACK
}
else
{
BH1750_SendACK(0); //»ØÓ¦ACK
}
}
BH1750_Stop(); //Í£Ö¹ÐźÅ
Delay5ms();
}
//³õʼ»¯BH1750£¬¸ù¾ÝÐèÒªÇë²Î¿¼pdf½øÐÐÐÞ¸Ä****
void Init_BH1750()
{
Single_Write_BH1750(0x01);
}
void Uart_Init()
{
TMOD = 0x20 | 0x01;
@ -71,12 +307,24 @@ void Bluetooth_Set(uchar *puf) @@ -71,12 +307,24 @@ void Bluetooth_Set(uchar *puf)
void Detection()
{
int i = 0;
if(key1==0) //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>K1<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>
Single_Write_BH1750(0x01);
Single_Write_BH1750(0x10);
delay_nms(180);
Multiple_Read_BH1750();
dis_data=BUF[0];
dis_data=(dis_data<<8)+BUF[1];
userInfo.Light = (float)dis_data/1.2;
userInfo.temp = Temper_change();
userInfo.temp /= 100;
if(key1==0)
{
Delay10ms(); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Delay10ms();
if(key1==0){
if(userInfo.model == 0) userInfo.model = 1;
else userInfo.model = 0;
if(userInfo.set == 0){
if(userInfo.model == 0) userInfo.model = 1;
else userInfo.model = 0;
}
}
while((i<50)&&(key1==0)){
Delay10ms();
@ -85,12 +333,19 @@ void Detection() @@ -85,12 +333,19 @@ void Detection()
i=0;
}
if(key2==0) //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>K1<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>
if(key2==0)
{
Delay10ms(); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Delay10ms();
if(key2==0){
if(userInfo.start == 0) userInfo.start = 1;
else userInfo.start = 0;
if(userInfo.model){
if(userInfo.start == 0) userInfo.start = 1;
else userInfo.start = 0;
}else{
if(userInfo.set == 0) userInfo.set = 1;
else userInfo.set = 0;
cut = 0;
}
LcdWriteCom(0x01); //清屏
}
while((i<50)&&(key2==0)){
Delay10ms();
@ -99,9 +354,9 @@ void Detection() @@ -99,9 +354,9 @@ void Detection()
i=0;
}
if(IN==0) //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>K1<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>
if(IN==0)
{
Delay10ms(); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Delay10ms();
if(IN==0){
userInfo.num++;
if(userInfo.num > 99) userInfo.num = 99;
@ -126,19 +381,82 @@ void Detection() @@ -126,19 +381,82 @@ void Detection()
}
i=0;
}
if(key3==0) //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>K1<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>
{
Delay10ms(); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if(key3==0){
cut++;
if(cut >= 4) cut = 0;
}
while((i<50)&&(key3==0)){
Delay10ms();
i++;
}
i=0;
}
if(key4==0) //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>K1<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>
{
Delay10ms(); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if(key4==0){
if(cut == 0){
userInfo.time[0].hour++;
if(userInfo.time[0].hour >= 24) userInfo.time[0].hour = 0;
}else if(cut == 1){
userInfo.time[0].min++;
if(userInfo.time[0].min >= 59) userInfo.time[0].min = 0;
}else if(cut == 2){
userInfo.time[1].hour++;
if(userInfo.time[1].hour >= 24) userInfo.time[1].hour = 0;
}else if(cut == 3){
userInfo.time[1].min++;
if(userInfo.time[1].min >= 59) userInfo.time[1].min = 0;
}
while((i<50)&&(key4==0)){
Delay10ms();
i++;
}
i=0;
}
}
}
int getTimeResult()
{
int result = 1;
struct Time Nowtime;
Nowtime.hour = TIME[2]/16 * 10 + (TIME[2]&0x0f);
Nowtime.min = TIME[1]/16 * 10 + (TIME[1]&0x0f);
if(Nowtime.hour < userInfo.time[0].hour || Nowtime.hour > userInfo.time[1].hour) return 0;
if(Nowtime.hour == userInfo.time[0].hour && Nowtime.min < userInfo.time[0].min) return 0;
if(Nowtime.hour == userInfo.time[1].hour && Nowtime.min > userInfo.time[1].min) return 0;
return result;
}
void Dispose()
{
if(userInfo.start && userInfo.model){
LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 0;
}else{
if(userInfo.Light < 50 && userInfo.model == 0){
if(userInfo.model == 0){
if(getTimeResult() && userInfo.Light < 100){
if(userInfo.num < 10 && userInfo.num > 0) LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 1;
else if(userInfo.num >= 10 && userInfo.num < 20) LED0 = 0, LED1 = 0, LED2 = 1 ,LED3 = 1;
else if(userInfo.num >= 20 && userInfo.num < 30) LED0 = 0, LED1 = 1, LED2 = 1 ,LED3 = 1;
else if(userInfo.num >= 30) LED0 = 1, LED1 = 1, LED2 = 1 ,LED3 = 1;
else LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 0;
}else{
LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 0;
}
}else{
if(userInfo.start){
LED0 = 1, LED1 = 1, LED2 = 1 ,LED3 = 1;
}else{
LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 0;
}
}
LED4 = userInfo.model;
@ -147,27 +465,99 @@ void Dispose() @@ -147,27 +465,99 @@ void Dispose()
void main()
{
int i = 0;
uchar str[30];
LcdInit();
uchar str[10];
Ds1302Init();
Uart_Init();
LcdInit();
userInfo.time[0].hour = 18;
userInfo.time[0].min = 0;
userInfo.time[0].sec = 0;
userInfo.time[1].hour = 23;
userInfo.time[1].min = 30;
userInfo.time[1].sec = 0;
while(1)
{
Ds1302ReadTime();
LcdDisplay();
Detection();
sprintf(str, "%d\r\n", userInfo.model);
Bluetooth_Set(str);
Dispose();
sprintf(str, "%d\r\n", userInfo.temp);
Bluetooth_Set(str);
}
}
void LcdDisplay()
{
// TODO 显示时间
LcdWriteCom(0x80);
LcdWriteData('m');
uint temp_data;
if(userInfo.set == 0){
// TODO 显示时间
LcdWriteCom(0x80);
LcdWriteData('0'+TIME[4]/16); //月
LcdWriteData('0'+(TIME[4]&0x0f));
LcdWriteData('-');
LcdWriteData('0'+TIME[3]/16); //日
LcdWriteData('0'+(TIME[3]&0x0f));
LcdWriteData(' ');
LcdWriteData('0'+TIME[2]/16); //时
LcdWriteData('0'+(TIME[2]&0x0f));
LcdWriteData(':');
LcdWriteData('0'+TIME[1]/16); //分
LcdWriteData('0'+(TIME[1]&0x0f));
LcdWriteData(':');
LcdWriteData('0'+TIME[0]/16); //秒
LcdWriteData('0'+(TIME[0]&0x0f));
LcdWriteData(' ');
LcdWriteData('0'+(TIME[5]&0x0f));
LcdWriteCom(0x80 + 0x40);
temp_data = userInfo.Light;
temp_data=temp_data%10000;
LcdWriteData(temp_data/1000+0x30);
temp_data=temp_data%1000;
LcdWriteData(temp_data/100+0x30);
temp_data=temp_data%100;
LcdWriteData(temp_data/10+0x30);
temp_data=temp_data%10;
LcdWriteData(temp_data+0x30);
LcdWriteData('L');
LcdWriteData('x');
LcdWriteData(' ');
LcdWriteData(userInfo.temp / 10 + 0x30);
LcdWriteData(userInfo.temp % 10 + 0x30);
LcdWriteData('C');
LcdWriteData(' ');
LcdWriteData(userInfo.num / 10 % 10 + 0x30);
LcdWriteData(userInfo.num % 10 + 0x30);
}else{
LcdWriteCom(0x80);
LcdWriteData('0'+ userInfo.time[0].hour/10); //时
LcdWriteData('0'+ userInfo.time[0].hour% 10);
LcdWriteData(':');
LcdWriteData('0'+userInfo.time[0].min/10); //分
LcdWriteData('0'+ userInfo.time[0].min % 10);
LcdWriteData(':');
LcdWriteData('0'+userInfo.time[0].sec / 10); //秒
LcdWriteData('0'+userInfo.time[0].sec % 10);
LcdWriteData(' ');
LcdWriteData('0'+cut);
LcdWriteCom(0x80 + 0x40);
LcdWriteData('0'+ userInfo.time[1].hour/10); //时
LcdWriteData('0'+ userInfo.time[1].hour% 10);
LcdWriteData(':');
LcdWriteData('0'+userInfo.time[1].min/10); //分
LcdWriteData('0'+ userInfo.time[1].min % 10);
LcdWriteData(':');
LcdWriteData('0'+userInfo.time[1].sec / 10); //秒
LcdWriteData('0'+userInfo.time[1].sec % 10);
}
}

BIN
pro

Binary file not shown.

1575
pro.M51

File diff suppressed because it is too large Load Diff

10
pro.build_log.htm

@ -19,19 +19,21 @@ CPU DLL: S8051.DLL V3.106.0.0 @@ -19,19 +19,21 @@ CPU DLL: S8051.DLL V3.106.0.0
Dialog DLL: DP51.DLL V2.63.0.0
<h2>Project:</h2>
E:\ÏîÄ¿\¼æÖ°ÏîÄ¿\20220428-IntelligentLighting\pro.uvproj
Project File Date: 04/29/2022
Project File Date: 04/30/2022
<h2>Output:</h2>
Build target 'Target 1'
compiling main.c...
compiling ds1302.c...
linking...
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?INIT_BH1750?MAIN
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?_AT24C02WRITE?I2C
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?_AT24C02READ?I2C
Program Size: data=77.1 xdata=0 code=2274
Program Size: data=95.1 xdata=0 code=5836
creating hex file from "pro"...
"pro" - 0 Error(s), 2 Warning(s).
"pro" - 0 Error(s), 3 Warning(s).
Build Time Elapsed: 00:00:00
</pre>
</body>

591
pro.hex

@ -1,173 +1,420 @@ @@ -1,173 +1,420 @@
:0508DD0025640D0A0076
:10083200758921759850758DFD858D8BE4F587D26C
:06084200AFD2ACD28E2201
:0708D600AE071FEE70FA22CD
:0E086D00C2ACC2998F993099FDC299D2AC22CB
:10081A00120515FF601112086D7F051208D67401C2
:08082A0029F9E43AFA80E92201
:10035F00E4F542F54320923A120897209212E50BEA
:10036F00450A7007F50A750B018005E4F50AF50BD0
:10037F00C3E5439432E54264809480501020920D7F
:10038F001208970543E54370E7054280E3E4F54221
:10039F00F54320933A120897209312E50D450C7000
:1003AF0007F50C750D018005E4F50CF50DC3E5435C
:1003BF009432E54264809480501020930D12089778
:1003CF000543E54370E7054280E3E4F542F543203A
:1003DF00B74112089720B7190509E50970020508FA
:1003EF00D39463E50864809480400675080075090E
:1003FF0063C3E5439432E54264809480501020B784
:10040F000D1208970543E54370E7054280E3E4F5D5
:10041F0042F54320B63E12089720B616E509150996
:10042F0070021508C3E508648094805005E4F50850
:10043F00F509C3E5439432E542648094805010205F
:10044F00B60D1208970543E54370E7054280E3E4D4
:04045F00F542F5432A
:010463002276
:10046400E50D450C6009E50B450A6003020504C36C
:10047400E50F9432E50E64809480400302050CE598
:100484000B450A600302050CC3E509940AE50864F8
:100494008094805016E5099400E5086480948040B7
:1004A4000AC282C281C280D284805DC3E509940AF3
:1004B400E508648094804012E5099414E50864809A
:1004C40094805006C282C2818030C3E5099414E549
:1004D40008648094804012E509941EE508648094C1
:1004E400805006C282D2818011C3E509941EE508BA
:1004F40064809480400AD282D281D280D2848008DF
:10050400C282C281C280C284E50A450B24FF928361
:0105140022C4
:1006BA00E4F522F5231207E81207A31208321208FA
:1006CA00481208A412035F7545FF7546087547DD91
:1006DA00850A48850B497B007A00792412005F7BE2
:0D06EA00007A00792412081A12046480D1ED
:0A08A4007F801208AE7F6D0208B8D5
:0C0897007F017E267D82DDFEDEFADFF6AA
:0108A3002232
:10072C00C2958FA07F017E0012073DD2947F057E7B
:01073C0000BC
:10073D00D3EF9400EE9400400F7DC77C01DCFEDD0D
:08074D00FAEF1F70EB1E80E8BB
:010755002281
:0A08AE00C294C29612072CC29422D5
:0A08B800C294D29612072CC29422BB
:1007E8007F381208AE7F0C1208AE7F061208AE7F63
:0907F800011208AE7F800208AE78
:0E087B0081838587898B8D80828486888A8C14
:0908C200071000012328040422A0
:1006F700C2B300C2B500D2B300E4FEEF1392B4EF69
:10070700C313FFD2B500C2B5000EBE08EEE4FEED7E
:100717001392B4EDC313FDD2B500C2B5000EBE08E7
:04072700EEC2B3006B
:01072B0022AB
:10062F00C2B300C2B500D2B300E4FDEF1392B4EF32
:10063F00C313FFD2B500C2B5000DBD08EE00E4FD37
:10064F00A2B4E433FFC43333335480FCEEC3134CF2
:10065F00FED2B500C2B5000DBD08E5C2B300D2B5DC
:09066F0000C2B400D2B400AF06D1
:01067800225F
:1007A300E4FD7F8E1206F7E4FCEC90088293FF745D
:1007B300102CF8E6FD1206F70CBC07ED7D807F8E4A
:0307C3000206F734
:10084800E4FBEB90087B93FF12062F74102BF8A69D
:05085800070BBB07EDDA
:01085D002278
:0508890012088ED2A14F
:08088E007F017E02DEFEDFFAAD
:01089600223F
:0F085E00D2A0120889C2A012088EC2A102088E71
:0A08CC00C2A0120889D2A002088E13
:02067900AD07CB
:10067B00E4FBFAEDC4131313540124FF92A0ED25F0
:10068B00E0FD120889C2A112088E0BBB08E5D2A0AF
:10069B0012088ED2A130A00F0AEAD394C840F6C23A
:0E06AB00A112088E7F0022C2A112088E7F01CC
:0106B900221E
:10077D00E4FDFCD2A012088ED2A112088EEC25E069
:10078D00FCA2A0E433420412088EC2A112088E0D01
:05079D00BD08E5AF04FA
:0107A2002234
:10080100AC05A90712085E7FA0120679AF01120696
:0908110079AF041206790208CC4B
:0207C600AC077E
:1007C80012085E7FA0120679AF0412067912085E3D
:0F07D8007FA112067912077DAD071208CCAF057D
:0107E70022EF
:030000000205A353
:0C05A300787FE4F6D8FD7581550205EA6A
:10051500BB010689828A83E0225002E722BBFE02E4
:09052500E32289828A83E4932217
:10000300E5512445F8E60551227842300702784548
:10001300E475F00112056D0205152000EB7F2ED269
:10002300008018EF540F2490D43440D4FF30040BD5
:10003300EF24BFB41A0050032461FFE55260021598
:10004300520555E5557002055430070D7842E475A5
:10005300F00112056DEF02055B0207567403D20728
:100063008003E4C207F5518B428A438944E4F55285
:10007300F554F555E55260077F2012003E80F57573
:1000830053FFC201C200C202C203C205C206C208B4
:1000930012000CFF700D3007057F0012004FAF55A3
:1000A300AE5422B4255FC2D5C20412000CFF24D083
:1000B300B40A00501A75F00A785230D50508B6FF15
:1000C3000106C6A426F620D5047002D20380D924E3
:1000D300CFB41A00EF5004C2E5D20402024FD2019A
:1000E30080C6D20080C0D20280BCD2D580BAD205ED
:1000F30080B47F2012003E2002077401B5520040F5
:10010300F1120003FF12003E020077D208D20680EC
:1001130095120003FB120003FA120003F94A4B7015
:100123000679207A037BFF20022EE552602A7E00A7
:100133008E8275830012052E60060EEE655370F0F5
:10014300C2D5EBC0E0EAC0E0E9C0E0EE120296D00F
:10015300E0F9D0E0FAD0E0FB120515FF60AAEBC08E
:10016300E0EAC0E0E9C0E012003ED0E02401F9D0AB
:10017300E03400FAD0E0FBE5530460DCD553D980CA
:10018300877BFF7A027992D202809C791080027970
:1001930008C206C2088008D2D5790A8004790AC247
:1001A300D5E553047002F553E4FAFDFEFF12000394
:1001B300FC7B08200113120003FD7B1030000A12A0
:1001C3000003FE120003FF7B20EC3382D592D5504F
:1001D30013C3E43000069FFFE49EFEE42001039D69
:1001E300FDE49CFCE4CBF8C201EC700CCFCECDCC8B
:1001F300E824F8F870F38017C3EF33FFEE33FEED16
:1002030033FDEC33FCEB33FB994002FB0FD8E9EBF6
:10021300300105F8D0E0C448B201C0E00AEC4D4E0D
:100223004F78207B0070C2EAB5530040BCC0E01297
:100233000298D0F0D0E0200104C4C0E0C4B201C0F1
:10024300F0120027D0F0D5F0EB02007712057D0104
:100253001453018E5800E54C00E14201924F019A7C
:0F02630044019A4900FA4301A0550184460184E1
:100272004501844703405000E92D00ED2E01102B6B
:1002820000F123010E2003292A00A94800000108D9
:100292003F3F3F00790AA2D5200314300509B91067
:1002A200020404B9080104A2D52006025001042068
:1002B20002689202B552005034C0E07F2030031928
:1002C2007F30A20272067205500F1202EFC202C202
:1002D20006C205C2087F30800F300503E9C0E01274
:1002E200003E300503D0E0F9D0E0B552CC3005171E
:1002F2007F30B9100C12003E7F583004077F78809F
:1003020003B9080312003E3002057F2D02003E7F32
:10031200202008F87F2B2006F322920280CF286E3D
:10032200756C6C2900D2011200033001F8C2017809
:100332005230D50108F60200A92D50434958120047
:10034200032403B405004001E490033B9312002F01
:0D035200743A12002FD20375520402018E7E
:1005AF000206BAE493A3F8E493A34003F68001F2A2
:1005BF0008DFF48029E493A3F85407240CC8C3334D
:1005CF00C4540F4420C8834004F456800146F6DF1C
:1005DF00E4800B01020408102040809008C2E47EE2
:1005EF00019360BCA3FF543F30E509541FFEE49311
:1005FF00A360010ECF54C025E060A840B8E493A3D8
:10060F00FAE493A3F8E493A3C8C582C8CAC583CA02
:10061F00F0A3C8C582C8CAC583CADFE9DEE780BEBA
:0108CB00002C
:10052E00BB010CE58229F582E5833AF583E0225082
:10053E0006E92582F8E622BBFE06E92582F8E222CC
:0D054E00E58229F582E5833AF583E49322E6
:10055B00BB010689828A83F0225002F722BBFE017F
:02056B00F32279
:10056D00FAE6FB0808E6F925F0F618E6CA3AF6228F
:10057D00D083D082F8E4937012740193700DA3A30D
:10058D0093F8740193F5828883E473740293686021
:06059D00EFA3A3A380DF21
:10075600EFB40A07740D120761740A309811A8994C
:10076600B8130CC2983098FDA899C298B811F63003
:0707760099FDC299F59922DB
:0516C70025640D0A007E
:04164D00024C00004B
:1014E200E4FDFCC3ED9FEC9E5015E4FBFA0BBB0040
:0F14F200010AEB64794A70F50DBD00010C80E42E
:0115010022C7
:1015F30000000000000000000000000000000000E8
:0116030022C4
:0E1604007F307E02EF1FAC0670011E4C70F6A8
:0116120022B5
:0F161300D290D2911215F3C2901215F3C2912208
:0C169100C290D2911215F3D2900215F312
:0E163100A2009290D2911215F3C2910215F30D
:0D167700D2911215F3A290C2911215F32228
:10153E00E4FEEF25E0FF9290D2911215F3C29112C4
:09154E0015F30EBE08EC0216773D
:10150200E4FFD290FEEF25E0FFD2911215F3A290F4
:0D151200E4334207C2911215F30EBE08E843
:01151F0022A9
:1015E100AD071216137F4612153EAF0512153E02C6
:0215F100169151
:101404001216137F4712153EE4FD12150274682D5F
:10141400F8A607BD0304D2008002C2001216310DE3
:09142400BD03E712169102160443
:0516C2007F010215E1AB
:1015A100758921759850758DFD858D8BE4F587D2F0
:0615B100AFD2ACD28E2285
:0716BB00AE071FEE70FA22DA
:0E163F00C2ACC2998F993099FDC299D2AC22EB
:1015890012057BFF601112163F7F051216BB74010D
:0815990029F9E43AFA80E92285
:100D9400E4F52EF52F7F011215E17F101215E17F86
:100DA400B47E001214E2121404754A0085684BE5FF
:100DB4004BFE7C00E42569F54BEC3EF54AFCAD4B5B
:100DC40012031F7B9A7A997999783F1202048F59FA
:100DD4008E588D578C5612124B8E5A8F5B7C007D29
:100DE400641206288E5A8F5B209240121684209239
:100DF40018E55345527012E55145507007F550758A
:100E040051018005E4F550F551C3E52F9432E52EE8
:100E140064809480501020920D121684052FE52FC3
:100E240070E7052E80E3E4F52EF52F20935E12166D
:100E340084209336E55145506014E55545547007B8
:100E4400F554755501801EE4F554F5558017E553A6
:100E540045527007F5527553018005E4F552F55378
:100E6400E4F54CF54D7F0112169DC3E52F9432E550
:100E74002E64809480501020930D121684052FE563
:100E84002F70E7052E80E3E4F52EF52F20B74112ED
:100E9400168420B719054FE54F7002054ED39463AD
:100EA400E54E648094804006754E00754F63C3E53B
:100EB4002F9432E52E64809480501020B70D1216C2
:100EC40084052FE52F70E7052E80E3E4F52EF52F3A
:100ED40020B63E12168420B616E54F154F70021543
:100EE4004EC3E54E648094805005E4F54EF54FC33F
:100EF400E52F9432E52E64809480501020B60D12B4
:100F04001684052FE52F70E7052E80E3E4F52EF512
:100F14002F20A24012168420A218054DE54D700220
:100F2400054CC39404E54C648094804005E4F54C7E
:100F3400F54DC3E52F9432E52E6480948050102043
:100F4400A20D121684052FE52F70E7052E80E3E429
:100F5400F52EF52F30A70302100D12168430A703C7
:100F640002100DE54D454C701A055DE55D700205F6
:100F74005CC39418E55C64809480406BE4F55CF594
:100F84005D8064E54D6401454C701A055FE55F7052
:100F940002055EC3943BE55E648094804049E4F5B9
:100FA4005EF55F8042E54D6402454C701A0563E5C9
:100FB4006370020562C39418E562648094804027DC
:100FC400E4F562F5638020E54D6403454C70180533
:100FD40065E56570020564C3943BE56464809480B0
:100FE4004005E4F564F565C3E52F9432E52E64808D
:100FF4009480501020A70D121684052FE52F70E75A
:09100400052E80E3E4F52EF52F22
:01100D0022C0
:1010CC007D017C00E50AC4540F75F00AA4FFAEF054
:1010DC00E50A540F7A002FF52FEA3EF52EE509C4E8
:1010EC00540F75F00AA4FFAEF0E509540F2FF5313B
:1010FC00EA3EF530C3E52F955DE55C6480F8E52E9E
:10110C00648098404BD3E52F9563E5626480F8E5E5
:10111C002E64809840028038E52FB55D18E52EB519
:10112C005C13C3E531955FE55E6480F8E53064805F
:10113C00985002801BE52FB5631AE52EB56215D3C6
:10114C00E5319565E5646480F8E530648098400489
:08115C00E4FEFF22AE04AF0522
:011164002268
:10100E00E551455060030210AB1210CCEF4E700349
:10101E000210A9E4FFFE7DC87C42AB59AA58A9571D
:10102E00A8561202A15074C3E54F940AE54E64808F
:10103E0094805016E54F9400E54E64809480400AEB
:10104E00C2A5C2A6C2A1D2A4806BC3E54F940AE585
:10105E004E648094804012E54F9414E54E64809463
:10106E00805006C2A5C2A6803EC3E54F9414E54E3D
:10107E00648094804012E54F941EE54E6480948007
:10108E005006C2A5D2A6801FC3E54F941EE54E643E
:10109E008094804018D2A5D2A6800C8010E55545CC
:1010AE0054600AD2A5D2A6D2A1D2A48008C2A5C2EB
:0E10BE00A6C2A1C2A4E550455124FF92A32270
:1011F100E4F522F5231215CD1215A1121557755CD0
:1012010000755D12E4F55EF55FF560F561F56275F7
:101211006317F56475651EF566F5671215B7120B50
:1012210011120D9412100E7531FF7532167533C7F8
:10123100855A34855B357B007A0079241206FE7B62
:0A124100007A00792412158980D18B
:100B1100E55345527F806003020C9212169DE50C4D
:100B2100C4540F2430FF1216A7E50C540F2430FFD4
:100B31001216A77F2D1216A7E50BC4540F2430FF00
:100B41001216A7E50B540F2430FF1216A77F2012AF
:100B510016A7E50AC4540F2430FF1216A7E50A545C
:100B61000F2430FF1216A77F3A1216A7E509C454C5
:100B71000F2430FF1216A7E509540F2430FF121677
:100B8100A77F3A1216A7E508C4540F2430FF1216A6
:100B9100A7E508540F2430FF1216A77F201216A7CD
:100BA100E50D540F2430FF1216A77FC012169DAF1A
:100BB10059AE58AD57AC561203588E2E8F2F7C2745
:100BC1007D101205D38C2E8D2FAE2EAF2F7C037D81
:100BD100E81205D3EF2430FF1216A7AE2EAF2F7CFB
:100BE100037DE81205D38C2E8D2FAE2EAF2F7C0006
:100BF1007D641205D3EF2430FF1216A7AE2EAF2F5E
:100C01007C007D641205D38C2E8D2FAE2EAF2F7CF0
:100C1100007D0A1205D3EF2430FF1216A7AE2EAFC6
:100C21002F7C007D0A1205D38C2E8D2FE52F2430C9
:100C3100FF1216A77F4C1216A77F781216A77F20E6
:100C41001216A7AE5AAF5B7C007D0A120628EF246C
:100C510030FF1216A7AE5AAF5B7C007D0A12062840
:100C6100ED2430FF1216A77F431216A77F2012161C
:100C7100A7AE4EAF4F7C007D0A1206287C007D0A8C
:100C8100120628ED2430FF1216A7AE4EAF4F020D0B
:100C91008512169DAE5CAF5D7C007D0A120628EFC1
:100CA1002430FF1216A7AE5CAF5D7C007D0A1206F0
:100CB10028ED2430FF1216A77F3A1216A7AE5EAFB9
:100CC1005F7C007D0A120628EF2430FF1216A7AEC2
:100CD1005EAF5F7C007D0A120628ED2430FF1216FC
:100CE100A77F3A1216A7AE60AF617C007D0A12069B
:100CF10028EF2430FF1216A7AE60AF617C007D0A99
:100D0100120628ED2430FF1216A77F201216A7E540
:100D11004D2430FF1216A77FC012169DAE62AF633D
:100D21007C007D0A120628EF2430FF1216A7AE625E
:100D3100AF637C007D0A120628ED2430FF1216A74E
:100D41007F3A1216A7AE64AF657C007D0A120628B1
:100D5100EF2430FF1216A7AE64AF657C007D0A1246
:100D61000628ED2430FF1216A77F3A1216A7AE66A9
:100D7100AF677C007D0A120628EF2430FF1216A708
:100D8100AE66AF677C007D0A120628ED2430FF12A3
:020D910016A7A3
:010D9300223D
:0C1684007F017E267D82DDFEDEFADFF6AF
:011690002237
:1013DA00C2958F807F017E001213EBD2947F057E27
:0113EA000002
:1013EB00D3EF9400EE9400400F7DC77C01DCFEDD53
:0813FB00FAEF1F70EB1E80E801
:0114030022C6
:0A169D00C294C2961213DAC294221E
:0A16A700C294D2961213DAC2942204
:101557007F3812169D7F0C12169D7F0612169D7FEF
:091567000112169D7F8002169D01
:0E165B0081838587898B8D80828486888A8C26
:091651000708002412010507221C
:1013A500C2B300C2B500D2B300E4FEEF1392B4EFAE
:1013B500C313FFD2B500C2B5000EBE08EEE4FEEDC4
:1013C5001392B4EDC313FDD2B500C2B5000EBE082D
:0413D500EEC2B300B1
:0113D90022F1
:10129A00C2B300C2B500D2B300E4FDEF1392B4EFBB
:1012AA00C313FFD2B500C2B5000DBD08EE00E4FDC0
:1012BA00A2B4E433FFC43333335480FCEEC3134C7B
:1012CA00FED2B500C2B5000DBD08E5C2B300D2B565
:0912DA0000C2B400D2B400AF065A
:0112E30022E8
:1015CD00E4FD7F8E1213A5E4FF0FBF07FC7D807F26
:0415DD008E0213A5C2
:1015B700E4FBEB90165B93FF12129A74082BF8A6C4
:0515C700070BBB07ED5E
:0115CC0022FC
:0516690012166ED2A173
:08166E007F017E02DEFEDFFABF
:011676002251
:0F162200D2A0121669C2A012166EC2A102166ED5
:0A16B100C2A0121669D2A002166E44
:02132600AD0711
:10132800E4FBFAEDC4131313540124FF92A0ED2536
:10133800E0FD121669C2A112166E0BBB08E5D2A019
:1013480012166ED2A130A00F0AEAD394C840F6C292
:0E135800A112166E7F0022C2A112166E7F0136
:011366002264
:10145400E4FDFCD2A012166ED2A112166EEC25E0A9
:10146400FCA2A0E433420412166EC2A112166E0D41
:05147400BD08E5AF0416
:011479002250
:10157000AC05A9071216227FA0121326AF01121381
:0915800026AF041213260216B175
:02149F00AC0798
:1014A1001216227FA0121326AF041213261216223F
:0F14B1007FA1121326121454AD071216B1AF0506
:0114C0002209
:10152000D3EF9400EE940040147D6E7C00ED1D70AE
:0D153000011CED4C70F7EF1F70E61E80E30C
:01153D00228B
:10147A00C2B27B46AF031BEF70FAD2B2E4FB30B2C2
:10148A00117F017E001215200BEBD3940540EF7FEC
:04149A0000227F01AC
:01149E00222B
:101367007D087C00C2B20FBF0000D2B20FBF0000E1
:101377000FBF0000A2B2E433C43333335480FBE918
:10138700C3134BF97E007F04EF1FAA0670011E4AA4
:0D13970070F6ED1D70011CED4C70C9AF012A
:0113A4002226
:0C12E40012147A7F017E001215207FCCCE
:1012F000E4FBFAC2B20536E53670020535EF13920B
:10130000B2753500753606E5361536AC3570021502
:10131000354C70F3D2B2EFC313FF0BBB00010AEBE5
:0513200064084A70CED4
:0113250022A5
:1014C100E4FFFE1212E47F441212F01212E47FBE16
:1014D1001212F01213678F34121367EFFEE534FF17
:0114E10022E8
:10124B001214C1C3EE9400500DEF1F70011E630703
:10125B00FF6306FF8000AD07AC06E412031FE4FB3F
:10126B00FA7980783D1200FB8F338E328D318C30C2
:10127B00E4FFFE7DC87C42AB33AA32A931A8301201
:0E128B0000FBE4FBFAF9783F12000A12035848
:011299002232
:100003000203C4E86480F8E933E83360110460F064
:10001300ED33EC337009E8FCE9FDEAFEEBFF220463
:1000230060DED3EB9FEA9EE99DE8C2E78CF0C2F75E
:1000330095F0400CE8CCF8E9CDF9EACEFAEBCFFB2A
:1000430012038F85D0F05804700320D5B3E80470F1
:10005300075002B2D50203CE92D5EC0460F7E4CC8C
:10006300C0E0C398F8603B94186008400DD0E0FBF3
:100073000203A6E4FBFAC9FC8028E830E406E4C9DD
:10008300FBE4CAFCE830E305E4C9CACBFCE8540747
:100093006010F8C3E913F9EA13FAEB13FBEC13FC52
:1000A300D8F130F52FC3E49CFCEF9BFFEE9AFEEDF5
:1000B30099FDD0E0FBEF4E4D4C701222DB0302039F
:1000C300CBEC2CFCEF33FFEE33FEED33FDED30E7ED
:1000D300EB0203A6EF2BFFEE3AFEED39FDD0E0FB7A
:1000E30050130BBB00030203CEED13FDEE13FEEF23
:0800F30013FFEC13FC0203A64D
:1000FB00EC4D6011E8497017ED33EC3304600DE4FF
:10010B00FCFFFEFD22E933E8330470F80203C4124E
:10011B00038F58046009E4CC24815006285009024F
:10012B0003CE2840030203CBC0E0EB4A7044B980F6
:10013B0006D0E0FB0203BAEF4E701CBD8008EBFF4C
:10014B00EAFEE9FD80EBE98DF0A4FEE5F00201E4A7
:10015B00E9CDF9EAFEEBFFEF89F0A4FCE5F0CE89DF
:10016B00F0A42EFFE435F0CD89F0A42DFEE435F09C
:10017B008067EF4E7005BD80D780C3EF8BF0A4ACCA
:10018B00F0EE8BF0A42CFCE435F0F8EF8AF0A42C05
:10019B00E5F038FCE433CB8DF0A42CFCE5F03BF818
:1001AB00EE8AF0A42CFCE5F038F8E433CF89F0A408
:1001BB002CFCE5F038CF3400CE89F0A42FFFE5F00E
:1001CB003EFEE433C98DF0A42EFEE5F039CD8AF066
:1001DB00A42FFFE5F03EFEE43DFD33D0E0FB5007DE
:1001EB000BBB000F0203CEEC2CFCEF33FFEE33FE08
:0601FB00ED33FD0203A636
:100201000203CEEC5D046005E8590470030203C4E7
:1002110012038F580460F6EC4860F2EC7004FDFEA6
:10022100FF22C860DB2481C85009C39860025006D0
:100231000203CB9850CAF582E9294B4A7005AB827B
:100241000203BA75F0007C1A7880C3EF9BEE9AED39
:1002510099400DC3EF9BFFEE9AFEED99FDE842F048
:10026100DC23ACF0D0E0FFD0E0FED0E0FDAB82209B
:10027100E7101BEB60BAEC2CFCEF33FFEE33FEED25
:1002810033FD0203A6E803F830E705C0F075F0007E
:10029100EF2FFFEE33FEED33FD40B830E7C280AA09
:1002A10074F8CC6480CCC86480C8F58204604FC304
:1002B100EB9FF5F0EA9E42F0E99D42F0E89C45F0A3
:1002C100603C501DE5825FFFE582D313CB5BCBF42D
:1002D1002B5582FB50280ABA002409B90020088056
:1002E1001DE5825BFBE582D313CF5FCFF4C3132FF0
:1002F1005582FF50090EBE00050DBD00010CC3EB78
:100301009FF5F0EA9E42F0E99D42F0E89C45F060DD
:0903110007CC4820E701B3EC22FF
:10031A0075F020800E75F010800575F0087D007E5E
:10032A00007F003392D530D50312065EEC334010BD
:10033A00EF33FFEE33FEED33FDEC33FCD5F0ED2267
:0E034A00E5F0247EA2D513CC92E7CDCEFF22A3
:10035800EDD2E7CD33EC3392D524814006E4FFFE9D
:10036800FDFC22FCE4CFCECDCC24E0501174FF80FC
:10037800EDC3CC13CCCD13CDCE13CECF13CF047099
:07038800F030D5DE02065E35
:1006A200E5452431F8E6054522782E3007027831F7
:1006B200E475F00112066C02057B2000EB7F2ED25E
:1006C200008018EF540F2490D43440D4FF30040B30
:1006D200EF24BFB41A0050032461FFE546600215FF
:1006E200460549E5497002054830070D782EE47544
:1006F200F00112066CEF0205C102142D7403D20739
:100702008003E4C207F5458B2E8A2F8930E4F54633
:10071200F548F549E54660077F201206DD80F5754C
:1007220047FFC201C200C202C203C205C206C2081A
:100732001206ABFF700D3007057F001206EEAF49BF
:10074200AE4822B4255FC2D5C2041206ABFF24D044
:10075200B40A00501A75F00A784630D50508B6FF7B
:100762000106C6A426F620D5047002D20380D9243D
:10077200CFB41A00EF5004C2E5D2040209DBD20161
:1007820080C6D20080C0D20280BCD2D580BAD20547
:1007920080B47F201206DD2002077401B5460040B6
:1007A200F11206A2FF1206DD020716D208D2068057
:1007B200951206A2FB1206A2FA1206A2F94A4B7081
:1007C2000679D27A0A7BFF20022EE546602A7E0055
:1007D2008E8275830012059460060EEE654770F0F6
:1007E200C2D5EBC0E0EAC0E0E9C0E0EE120A3BD0BD
:1007F200E0F9D0E0FAD0E0FB12057BFF60AAEBC083
:10080200E0EAC0E0E9C0E01206DDD0E02401F9D060
:10081200E03400FAD0E0FBE5470460DCD547D9803C
:1008220087D20280A2120A1E60F7E5477001041205
:1008320003D9A947600DE547600914F547120AC5B7
:10084200EF60F3EA30E702F404C3995077EAF42543
:10085200470430E701E404F547800D120A1E60C127
:10086200EA054725471203D9EA7844F630E701E45E
:10087200254704D5470420050114120A3BE4C0E0D1
:10088200120AC57844E6601320E70714F61206C57B
:10089200802204F6D0E014C0E07F001206C5E547CE
:1008A20060071206BC1547800B3005031206BCD048
:1008B200E0020716D0E00480C5120A1E60A0E547D8
:1008C200041203D97844EAF6E547200502600104E0
:0508D2002404120A3BA2
:1008D70074FF04C0E0120AC51206C5E547200502E9
:1008E70060031206BCD0E0B547E87F451206CF7813
:1008F70044E67F2B30E7047F2DF404C0E01206DDC9
:10090700D0E075F00A84C0F01206C6D0E01206C621
:10091700020716791080027908C206C2088008D239
:10092700D5790A8004790AC2D5E547047002F547EC
:10093700E4FAFDFEFF1206A2FC7B08200113120653
:10094700A2FD7B1030000A1206A2FE1206A2FF7B50
:1009570020EC3382D592D55013C3E43000069FFFB5
:10096700E49EFEE42001039DFDE49CFCE4CBF8C279
:1009770001EC700CCFCECDCCE824F8F870F38017DB
:10098700C3EF33FFEE33FEED33FDEC33FCEB33FB0C
:10099700994002FB0FD8E9EB300105F8D0E0C448D5
:1009A700B201C0E00AEC4D4E4F78207B0070C2EADE
:1009B700B5470040BCC0E0120A3DD0F0D0E02001AE
:1009C70004C4C0E0C4B201C0F01206C6D0F0D5F02E
:1009D700EB02071612067C07B353091A5807844C13
:1009E700078042091E4F09264409264907994309EA
:1009F7002C55085D4608BB450827470AF25007886B
:100A07002D078C2E07AF2B07902307AD200ADB2A73
:100A1700074848000007A7E547B4FF0375470612D4
:100A270006A2FC1206A2FD1206A2FE1206A2FF787B
:100A37003D020408790AA2D5200314300509B9102C
:100A4700020404B9080104A2D520060250010420BB
:100A570002689202B546005034C0E07F2030031987
:100A67007F30A20272067205500F120A94C202C2A8
:100A770006C205C2087F30800F300503E9C0E012C7
:100A870006DD300503D0E0F9D0E0B546CC300517D8
:100A97007F30B9100C1206DD7F583004077F78804D
:100AA70003B908031206DD3002057F2D0206DD7F3C
:100AB700202008F87F2B2006F322920280CF7F00A8
:100AC700B407005005243DF8E6FF22286E756C6CCC
:100AD7002900D2011206A23001F8C201784630D5AA
:100AE7000108F60207482D504349581206A224036D
:100AF700B405004001E4900AED931206CE743A1251
:0A0B070006CED20375460402091A57
:10038F00E9D2E7C933E833F892D5EDD2E7CD33ECB4
:07039F0033FC5002B2D5222D
:1003A600EC30E7100FBF000C0EBE00080DBD0004B8
:1003B6000BEB6014A2D5EB13FCED92E7FD2274FF64
:1003C600FCFDFEFF22E480F8A2D574FF13FC7D80BD
:0303D600E480EFD1
:1003D900F920E72824F950037907E4F42402FB18EB
:1003E900DBFDE624FB5014E9600DE4F618E604F69B
:0F03F900B40A08E4F6D9F57401F60A22C2D52237
:10040800ED33EC3392D5FA602AB4FF33EDC2E77BC3
:10041800FF60067A04792DE4227A04793620D5041F
:100428007A047931224E614E002B494E46002D49FF
:100438004E4600E47A08F608DAFC7B00740722E8E6
:10044800C0E0ECC0E0EDC0E0EEC0E0EFC0E0EA756F
:10045800F010A4CAABF075F04DA42BFBE435F0FC0A
:10046800EA2410FAEB34C5FBEC34D9FCEDC2E7FF03
:1004780075F056A4F42411C5F0F434C58FF0A42AFD
:10048800E5F03BE43CF620E71412053BD0E0FFD052
:10049800E0FED0E0FDD0E0FC1202048014F4041267
:1004A800053BD0E0FFD0E0FED0E0FDD0E0FC12003C
:1004B800FBD0E0F8E6FAEDD2E7CD33EC332482FB4B
:1004C800E4C3CF33CFCE33CECD33CD33DBF37B078D
:1004D80075F00A846004F6081B0AE5F0F6088FF048
:1004E800740AA4FFACF08EF0740AA42CFEACF05091
:1004F800010C8DF0740AA42CFDE435F0F608DBDE5F
:0305080074072253
:10050B003F8000004120000042C80000447A0000F8
:10051B00461C400047C35000497424004B1896807A
:10052B004CBEBC205A0E1BCA6753C21C749DC5AE71
:10053B00FB60065407601C2323120569EB543860DB
:10054B00091205551205641200FBECF8EDF9EEFAF1
:10055B00EFCB22EB12056480F1543803241C900579
:10056B000BFE93FC0EEE93FD0EEE930ECE93FF223D
:0300000002116585
:0C116500787FE4F6D8FD75816F0211ACB4
:10057B00BB010689828A83E0225002E722BBFE027E
:09058B00E32289828A83E49322B1
:10059400BB010CE58229F582E5833AF583E022501C
:1005A40006E92582F8E622BBFE06E92582F8E22266
:0D05B400E58229F582E5833AF583E4932280
:1005C100BB010689828A83F0225002F722BBFE0119
:0205D100F32213
:1005D300BC000BBE0029EF8DF084FFADF022E4CC0C
:1005E300F875F008EF2FFFEE33FEEC33FCEE9DECD5
:1005F300984005FCEE9DFE0FD5F0E9E4CEFD22ED1B
:10060300F8F5F0EE8420D21CFEADF075F008EF2F64
:10061300FFED33FD4007985006D5F0F222C398FD55
:050623000FD5F0EA22F2
:10062800C2D5EC30E709B2D5E4C39DFDE49CFCEEED
:1006380030E715B2D5E4C39FFFE49EFE1205D3C38D
:10064800E49DFDE49CFC80031205D330D507C3E488
:060658009FFFE49EFE225C
:0E065E00C3E49FFFE49EFEE49DFDE49CFC22AD
:10066C00FAE6FB0808E6F925F0F618E6CA3AF6228F
:10067C00D083D082F8E4937012740193700DA3A30D
:10068C0093F8740193F5828883E473740293686021
:06069C00EFA3A3A380DF21
:10142D00EFB40A07740D121438740A309811A89984
:10143D00B8130CC2983098FDA899C298B811F6301F
:07144D0099FDC299F59922F7
:101171000211F1E493A3F8E493A34003F68001F292
:1011810008DFF48029E493A3F85407240CC8C3337F
:10119100C4540F4420C8834004F456800146F6DF4E
:1011A100E4800B010204081020408090164DE47E7B
:1011B100019360BCA3FF543F30E509541FFEE49343
:1011C100A360010ECF54C025E060A840B8E493A30A
:1011D100FAE493A3F8E493A3C8C582C8CAC583CA35
:1011E100F0A3C8C582C8CAC583CADFE9DEE780BEED
:01165A00008F
:00000001FF

3
pro.lnp

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
"main.obj",
"lcd.obj",
"ds1302.obj",
"i2c.obj"
"i2c.obj",
"DS18B20.obj"
TO "pro"

69
pro.uvgui.QY

File diff suppressed because one or more lines are too long

14
pro.uvopt

@ -191,7 +191,7 @@ @@ -191,7 +191,7 @@
<GroupNumber>1</GroupNumber>
<FileNumber>1</FileNumber>
<FileType>1</FileType>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\main.c</PathWithFileName>
@ -235,6 +235,18 @@ @@ -235,6 +235,18 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>1</GroupNumber>
<FileNumber>5</FileNumber>
<FileType>1</FileType>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\DS18B20.c</PathWithFileName>
<FilenameWithoutPath>DS18B20.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
</ProjectOpt>

5
pro.uvproj

@ -396,6 +396,11 @@ @@ -396,6 +396,11 @@
<FileType>1</FileType>
<FilePath>.\i2c.c</FilePath>
</File>
<File>
<FileName>DS18B20.c</FileName>
<FileType>1</FileType>
<FilePath>.\DS18B20.c</FilePath>
</File>
</Files>
</Group>
</Groups>

Loading…
Cancel
Save