VB与单片机通信实现智能照明温度控制示例
包括Vb代码和C代码
源代码在线查看: function.lst
C51 COMPILER V8.02 FUNCTION 11/20/2007 19:40:01 PAGE 1
C51 COMPILER V8.02, COMPILATION OF MODULE FUNCTION
OBJECT MODULE PLACED IN function.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE function.c BROWSE DEBUG OBJECTEXTEND
line level source
1 #include
2 #include "serial.h"
3 unsigned char manualcon,light,aircon;
4 sbit L1=P3^2;
5 sbit L2=P3^3;
6 bit GetRoom()
7 {
8 1 SerialRet[0]=3;
9 1 SerialRet[1]=3;
10 1 SerialRet[2]=11;
11 1 SerialRet[3]=CheckSum(SerialRet);
12 1 return 1;
13 1 }
14 bit GetData()
15 {
16 1 SerialRet[0]=5;
17 1 SerialRet[1]=light;
18 1 SerialRet[2]=aircon;
19 1 SerialRet[3]=manualcon;
20 1 SerialRet[4]=1;
21 1 SerialRet[5]=CheckSum(SerialRet);
22 1 return 1;
23 1 }
24 bit SetManTime()
25 {
26 1 SerialRet[0]=0;
27 1 return 1;
28 1 }
29 bit SetManCon(bit m)
30 {
31 1 SerialRet[0]=0;
32 1 manualcon=m;
33 1 return 1;
34 1 }
35 bit SetLight()
36 {
37 1 SerialRet[0]=0;
38 1 light=SerialCmd[2];
39 1 L1=!(light&0x01);
40 1 L2=!(light&0x02);
41 1 return 1;
42 1 }
43 bit SetAirCon()
44 {
45 1 SerialRet[0]=0;
46 1 aircon=SerialCmd[2];
47 1 return 1;
48 1 }
49 bit SetTime()
50 {
51 1 SerialRet[0]=0;
52 1 return 1;
53 1 }
C51 COMPILER V8.02 FUNCTION 11/20/2007 19:40:01 PAGE 2
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 99 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 3 ----
IDATA SIZE = ---- ----
BIT SIZE = ---- 1
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)