Browse Source

完成大部分功能

master
htujun 3 years ago
parent
commit
703eb18952
  1. 319
      IRIN.LST
  2. BIN
      IRIN.OBJ
  3. 217
      IRIN.c
  4. 10
      IRIN.h
  5. 6
      i2c.LST
  6. BIN
      i2c.OBJ
  7. 1
      i2c.__i
  8. 1
      i2c.h
  9. 4
      lcd.LST
  10. BIN
      lcd.OBJ
  11. 342
      main.LST
  12. BIN
      main.OBJ
  13. 223
      main.c
  14. BIN
      pro
  15. 1392
      pro.M51
  16. 7
      pro.build_log.htm
  17. 597
      pro.hex
  18. 109
      pro.uvgui.QY
  19. 6
      pro.uvopt
  20. 172
      pwm.LST
  21. BIN
      pwm.OBJ
  22. 128
      pwm.c
  23. 21
      pwm.h

319
IRIN.LST

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
C51 COMPILER V9.56.0.0 IRIN 04/06/2022 23:56:38 PAGE 1
C51 COMPILER V9.56.0.0 IRIN 04/08/2022 03:09:39 PAGE 1
C51 COMPILER V9.56.0.0, COMPILATION OF MODULE IRIN
@ -10,223 +10,120 @@ line level source @@ -10,223 +10,120 @@ line level source
1 #include "IRIN.h"
2 #include "i2c.h"
3
4 uint journey;
5 uint journey1;
6 extern uchar pwm_left;
7 unsigned int b;
8 unsigned int c;
9 extern uint time1;
10 extern uchar pwm_val_left;
11 unsigned int b2;
12 unsigned int c2;
13
14 uint money=7;
15 uint sudu=0;
16
17 uint count=0; //栅格是一圈20个
18
19 uchar ms=0;
20 uint speed=0;
21 uint r_s=0;
22
23 bit state=0;
24 bit s0=0;
25 bit flas=0;
26
27 uchar sec=0;
28 uchar sec1=0;
29
30 /*******************************************************************************
31 * 函 数 名 : delay
32 * 函数功能 : 延时函数,i=1时,大约延时10us
33 *******************************************************************************/
34 void delay11(int i)
35 {
36 1 while(i--);
37 1 }
38
39 void IRIN_Init(void)
40 {
41 1 TMOD=0x01 | 0x20 ;//定时器1工作方式1
42 1 TH0=0x3C;
43 1 TL0=0xb0;
44 1 ET0=1;
45 1 TR0=1;
46 1 EA=1;
47 1 EX1=1;
48 1 IT1=1;
49 1 }
50
51 void display()
52 {
53 1 if(state==0)
54 1 {
55 2 sudu=At24c02Read(10);
C51 COMPILER V9.56.0.0 IRIN 04/06/2022 23:56:38 PAGE 2
4 uint mileage = 0;
5
6 uint count=0;
7
8 uchar ms=0;
9 uint speed=0;
10 uint r_s=0;
11
12 extern uint model;
13 extern uchar set;
14
15 void delay11(int i)
16 {
17 1 while(i--);
18 1 }
19
20 void IRIN_Init(void)
21 {
22 1 TMOD=0x01 | 0x20;
23 1 TH0=0XFc;
24 1 TL0=0X18;
25 1 ET0=1;
26 1 TR0=1;
27 1 EA=1;
28 1 EX1=1;
29 1 IT1=1;
30 1 }
31
32 void display()
33 {
34 1 LcdSetCursor(0,0);
35 1 LcdShowStr(0,0,"");
36 1 Lcd1602_Write_Data(0x30+speed/100%10);
37 1 Lcd1602_Write_Data(0x30+speed/10%10);
38 1 Lcd1602_Write_Data(0x30+speed%10);
39 1 LcdShowStr(3,0,"KM/h ");
40 1
41 1 LcdShowStr(8,0,"");
42 1 Lcd1602_Write_Data(0x30+mileage/100%10);
43 1 Lcd1602_Write_Data(0x30+mileage/10%10);
44 1 Lcd1602_Write_Data(0x30+mileage%10);
45 1 LcdShowStr(11,0,"m ");
46 1
47 1 if(model == 0) LcdShowStr(13,0," ");
48 1 else if(model == 1) LcdShowStr(13, 0, "L");
49 1 else if(model == 2) LcdShowStr(13, 0, "M");
50 1 else LcdShowStr(13, 0, "H");
51 1 }
52
53
54 void Key_scan(){
55 1 if(k1==0)
C51 COMPILER V9.56.0.0 IRIN 04/08/2022 03:09:39 PAGE 2
56 2 if(money>7)
57 2 {
58 3 money=At24c02Read(5);
59 3 }
60 2 LcdSetCursor(0,0);
61 2 LcdShowStr(0,0,"Speed:");
62 2 Lcd1602_Write_Data(0x30+sudu/100%10);
63 2 Lcd1602_Write_Data(0x30+sudu/10%10);
64 2 Lcd1602_Write_Data(0x30+sudu%10);
65 2 LcdShowStr(10,0,"KM/h");
66 2
67 2 LcdShowStr(0,1,"L:");
68 2 Lcd1602_Write_Data(journey/10000%10+0x30);
69 2 Lcd1602_Write_Data(journey/1000%10+0x30);
70 2 Lcd1602_Write_Data(journey/100%10+0x30);
71 2 Lcd1602_Write_Data(journey/10%10+0x30);
72 2 Lcd1602_Write_Data(journey%10+0x30);
73 2 LcdShowStr(7,1,"M");
74 2
75 2 if(journey>1000)
76 2 {
77 3 money=(journey-1000)*0.002+7;
78 3 At24c02Write(5,money);
79 3 }
80 2 money=money*10;
81 2 LcdShowStr(9,1,"Q:");
82 2 Lcd1602_Write_Data(money/1000%10+0x30);
83 2 Lcd1602_Write_Data(money/100%10+0x30);
84 2 Lcd1602_Write_Data(money/10%10+0x30);
85 2 LcdShowStr(14,1,".");
86 2 Lcd1602_Write_Data(money%10+0x30);
87 2
88 2 money=money/10;
89 2
90 2 }
91 1 }
92
93
94
95 void keypros()
96 {
97 1 if(k2==0)
98 1 {
99 2 delay11(1000); //消抖处理
100 2 if(k2==0)
101 2 {
102 3 sudu=At24c02Read(10); //读取EEPROM地址1内的数据
103 3
104 3 b2=At24c02Read(1);
105 3 c2=At24c02Read(8);
106 3 journey=(b2<<8) | c2;
107 3
108 3 money=At24c02Read(5);
109 3
110 3 }
111 2 while(!k2);
112 2 }
113 1
114 1 if(k1==0)
115 1 {
116 2 delay11(1000); //消抖处理
117 2 if(k1==0)
C51 COMPILER V9.56.0.0 IRIN 04/06/2022 23:56:38 PAGE 3
118 2 {
119 3 flas=1;
120 3
121 3 }
122 2 while(!k1);
123 2 }
124 1 if(k4==0)
125 1 {
126 2 delay11(1000); //消抖处理
127 2 if(k4==0)
128 2 {
129 3 if(pwm_left>=20)
130 3 {
131 4 pwm_left=1;
132 4 }
133 3 else
134 3 {
135 4 pwm_left++;
136 4 }
137 3 }
138 2 while(!k4);
139 2 }
140 1
141 1 }
142
143 void time0() interrupt 1 //定时器 0
144 {
145 1 TH0=0x3C;
146 1 TL0=0xb0; //50ms定时
147 1 ms++; //变量50ms加一
148 1 if(ms%5==0) s0=~s0;
149 1
150 1
151 1 if(ms%10==0) //500ms定时
152 1 {
153 2
154 2 if(sec!=0) sec--;
155 2 if(sec1!=0) sec1--;
156 2 ms=0; //清零变量
157 2 EX1=0; //关闭外部中断,保证变量在计算的时候不会增加
158 2 r_s=count; //因为是500ms检测一次转动数据,所以要想一秒转动的圈数是 speed=count*2 ,但是光栅是一圈2
-0格,所以还要除以20;
159 2 //综合一下,一秒转动的圈数就是 speed=count*2/20 ==》 speed=counr/10;
160 2 count=0; //清零变量
161 2 EX1=1; //打开外部中断
162 2 speed=speed*0.5+(r_s*6)*0.5; // 这里r_s是一秒走的圈数,然后乘以60得到60秒走的圈数,单位变成了
- r/min; 总方式 speed=count/10*60; ==>> speed=count*6;
163 2
164 2 if(flas==0)
165 2 {
166 3 sudu=(0.15*speed);
167 3 At24c02Write(10,sudu);
168 3
169 3 journey=journey+(r_s*2.5/20);
170 3 journey1=journey;
171 3 c = journey & 0x00FF;
172 3 At24c02Write(8,c);
173 3
174 3 delay11(1000);
175 3 b=journey1>>8;
176 3 At24c02Write(1,b);
177 3 }
C51 COMPILER V9.56.0.0 IRIN 04/06/2022 23:56:38 PAGE 4
178 2 else
179 2 {
180 3 journey=0;
181 3 money=7;
182 3 At24c02Write(1,journey);
183 3 At24c02Write(8,journey);
184 3 At24c02Write(5,money);
185 3 flas=0;
186 3 }
187 2 }
188 1 }
189
190 void int1() interrupt 2 //外部中断 1
191 {
192 1
193 1 count++; //中断每触发一次,变量加一
194 1
195 1 }
196
197
198
199
200
201
202
56 1 {
57 2 delay11(1000); //Ïû¶¶´¦Àí
58 2 if(k1==0){
59 3 model++;
60 3 if(model >= 4) model = 0;
61 3 }
62 2 while(!k1);
63 2 }
64 1
65 1 if(k2==0)
66 1 {
67 2 delay11(1000); //Ïû¶¶´¦Àí
68 2 if(k2==0){
69 3 set = 1;
70 3 }
71 2 while(!k2);
72 2 }
73 1
74 1 }
75
76 void time0() interrupt 1
77 {
78 1 static int time = 0;
79 1 TH0=0XFc;
80 1 TL0=0X18;
81 1 time++;
82 1 pwm_out_right_moto();
83 1 if(time >= 500){
84 2 EX1=0;
85 2 time = 0;
86 2 r_s=count;
87 2 count=0;
88 2 EX1=1;
89 2 speed=speed*0.5+(r_s*6)*0.5;
90 2 speed=(0.15*speed);
91 2 mileage = mileage+(r_s*2.5/20);
92 2 }
93 1 }
94
95 void int1() interrupt 2
96 {
97 1 count++;
98 1 }
99
100
101
102
103
104
105
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1006 ----
CONSTANT SIZE = 22 ----
CODE SIZE = 623 ----
CONSTANT SIZE = 26 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 25 ----
DATA SIZE = 11 ----
IDATA SIZE = ---- ----
BIT SIZE = 3 ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.

BIN
IRIN.OBJ

Binary file not shown.

217
IRIN.c

@ -1,36 +1,17 @@ @@ -1,36 +1,17 @@
#include "IRIN.h"
#include "i2c.h"
uint journey;
uint journey1;
extern uchar pwm_left;
unsigned int b;
unsigned int c;
extern uint time1;
extern uchar pwm_val_left;
unsigned int b2;
unsigned int c2;
uint mileage = 0;
uint money=7;
uint sudu=0;
uint count=0; //栅格是一圈20个
uint count=0;
uchar ms=0;
uint speed=0;
uint r_s=0;
bit state=0;
bit s0=0;
bit flas=0;
uchar sec=0;
uchar sec1=0;
extern uint model;
extern uchar set;
/*******************************************************************************
* : delay
* : i=110us
*******************************************************************************/
void delay11(int i)
{
while(i--);
@ -38,9 +19,9 @@ void delay11(int i) @@ -38,9 +19,9 @@ void delay11(int i)
void IRIN_Init(void)
{
TMOD=0x01 | 0x20 ;//定时器1工作方式1
TH0=0x3C;
TL0=0xb0;
TMOD=0x01 | 0x20;
TH0=0XFc;
TL0=0X18;
ET0=1;
TR0=1;
EA=1;
@ -49,150 +30,72 @@ void IRIN_Init(void) @@ -49,150 +30,72 @@ void IRIN_Init(void)
}
void display()
{
if(state==0)
{
sudu=At24c02Read(10);
if(money>7)
{
money=At24c02Read(5);
}
LcdSetCursor(0,0);
LcdShowStr(0,0,"Speed:");
Lcd1602_Write_Data(0x30+sudu/100%10);
Lcd1602_Write_Data(0x30+sudu/10%10);
Lcd1602_Write_Data(0x30+sudu%10);
LcdShowStr(10,0,"KM/h");
LcdShowStr(0,1,"L:");
Lcd1602_Write_Data(journey/10000%10+0x30);
Lcd1602_Write_Data(journey/1000%10+0x30);
Lcd1602_Write_Data(journey/100%10+0x30);
Lcd1602_Write_Data(journey/10%10+0x30);
Lcd1602_Write_Data(journey%10+0x30);
LcdShowStr(7,1,"M");
if(journey>1000)
{
money=(journey-1000)*0.002+7;
At24c02Write(5,money);
}
money=money*10;
LcdShowStr(9,1,"Q:");
Lcd1602_Write_Data(money/1000%10+0x30);
Lcd1602_Write_Data(money/100%10+0x30);
Lcd1602_Write_Data(money/10%10+0x30);
LcdShowStr(14,1,".");
Lcd1602_Write_Data(money%10+0x30);
money=money/10;
}
}
void keypros()
{
if(k2==0)
{
delay11(1000); //消抖处理
if(k2==0)
{
sudu=At24c02Read(10); //读取EEPROM地址1内的数据
b2=At24c02Read(1);
c2=At24c02Read(8);
journey=(b2<<8) | c2;
money=At24c02Read(5);
}
while(!k2);
}
{
LcdSetCursor(0,0);
LcdShowStr(0,0,"");
Lcd1602_Write_Data(0x30+speed/100%10);
Lcd1602_Write_Data(0x30+speed/10%10);
Lcd1602_Write_Data(0x30+speed%10);
LcdShowStr(3,0,"KM/h ");
LcdShowStr(8,0,"");
Lcd1602_Write_Data(0x30+mileage/100%10);
Lcd1602_Write_Data(0x30+mileage/10%10);
Lcd1602_Write_Data(0x30+mileage%10);
LcdShowStr(11,0,"m ");
if(model == 0) LcdShowStr(13,0," ");
else if(model == 1) LcdShowStr(13, 0, "L");
else if(model == 2) LcdShowStr(13, 0, "M");
else LcdShowStr(13, 0, "H");
}
void Key_scan(){
if(k1==0)
{
delay11(1000); //消抖处理
if(k1==0)
{
flas=1;
if(k1==0){
model++;
if(model >= 4) model = 0;
}
while(!k1);
}
if(k4==0)
if(k2==0)
{
delay11(1000); //消抖处理
if(k4==0)
{
if(pwm_left>=20)
{
pwm_left=1;
}
else
{
pwm_left++;
}
if(k2==0){
set = 1;
}
while(!k4);
while(!k2);
}
}
void time0() interrupt 1 //定时器 0
{
TH0=0x3C;
TL0=0xb0; //50ms定时
ms++; //变量50ms加一
if(ms%5==0) s0=~s0;
if(ms%10==0) //500ms定时
{
if(sec!=0) sec--;
if(sec1!=0) sec1--;
ms=0; //清零变量
EX1=0; //关闭外部中断,保证变量在计算的时候不会增加
r_s=count; //因为是500ms检测一次转动数据,所以要想一秒转动的圈数是 speed=count*2 ,但是光栅是一圈20格,所以还要除以20;
//综合一下,一秒转动的圈数就是 speed=count*2/20 ==》 speed=counr/10;
count=0; //清零变量
EX1=1; //打开外部中断
speed=speed*0.5+(r_s*6)*0.5; // 这里r_s是一秒走的圈数,然后乘以60得到60秒走的圈数,单位变成了 r/min; 总方式 speed=count/10*60; ==>> speed=count*6;
if(flas==0)
{
sudu=(0.15*speed);
At24c02Write(10,sudu);
journey=journey+(r_s*2.5/20);
journey1=journey;
c = journey & 0x00FF;
At24c02Write(8,c);
delay11(1000);
b=journey1>>8;
At24c02Write(1,b);
}
else
{
journey=0;
money=7;
At24c02Write(1,journey);
At24c02Write(8,journey);
At24c02Write(5,money);
flas=0;
}
}
void time0() interrupt 1
{
static int time = 0;
TH0=0XFc;
TL0=0X18;
time++;
pwm_out_right_moto();
if(time >= 500){
EX1=0;
time = 0;
r_s=count;
count=0;
EX1=1;
speed=speed*0.5+(r_s*6)*0.5;
speed=(0.15*speed);
mileage = mileage+(r_s*2.5/20);
}
}
void int1() interrupt 2 //外部中断 1
{
count++; //中断每触发一次,变量加一
}
void int1() interrupt 2
{
count++;
}

10
IRIN.h

@ -5,19 +5,13 @@ @@ -5,19 +5,13 @@
#include "lcd.h"
#include "pwm.h"
sbit k1=P3^5;
sbit k2=P3^4;
sbit k3=P3^3;
sbit k4=P3^2; //¶¨Òå°´¼ü¶Ë¿Ú
sbit k1=P3^5;
sbit k2=P3^2;
void IRIN_Init(void);
void display();
void keypros();
#endif

6
i2c.LST

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
C51 COMPILER V9.56.0.0 I2C 04/06/2022 22:40:09 PAGE 1
C51 COMPILER V9.56.0.0 I2C 04/08/2022 02:58:55 PAGE 1
C51 COMPILER V9.56.0.0, COMPILATION OF MODULE I2C
@ -62,7 +62,7 @@ line level source @@ -62,7 +62,7 @@ line level source
53 /*******************************************************************************
54 * 函数名 : I2cSendByte(unsigned char dat)
55 * 函数功能 : 通过I2C发送一个字节。在SCL时钟信号高电平期间,保持发送信号SDA保持稳定
C51 COMPILER V9.56.0.0 I2C 04/06/2022 22:40:09 PAGE 2
C51 COMPILER V9.56.0.0 I2C 04/08/2022 02:58:55 PAGE 2
56 * 输入 : num
57 * 输出 : 0或1。发送成功返回1,发送失败返回0
@ -126,7 +126,7 @@ line level source @@ -126,7 +126,7 @@ line level source
115 1 }
116
117
C51 COMPILER V9.56.0.0 I2C 04/06/2022 22:40:09 PAGE 3
C51 COMPILER V9.56.0.0 I2C 04/08/2022 02:58:55 PAGE 3
118 /*******************************************************************************
119 * 函数名 : void At24c02Write(unsigned char addr,unsigned char dat)

BIN
i2c.OBJ

Binary file not shown.

1
i2c.__i

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

1
i2c.h

@ -12,5 +12,6 @@ unsigned char I2cSendByte(unsigned char dat); @@ -12,5 +12,6 @@ unsigned char I2cSendByte(unsigned char dat);
unsigned char I2cReadByte();
void At24c02Write(unsigned char addr,unsigned char dat);
unsigned char At24c02Read(unsigned char addr);
void Delay10us();
#endif

4
lcd.LST

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
C51 COMPILER V9.56.0.0 LCD 04/06/2022 22:23:01 PAGE 1
C51 COMPILER V9.56.0.0 LCD 04/08/2022 02:58:55 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
53 1 X &= 0xF; //限制X不能大于15,Y不能大于1
54 1 if (Y) X |= 0x40; //当要显示第二行时地址码+0x40;
55 1 X |= 0x80; //算出指令码
C51 COMPILER V9.56.0.0 LCD 04/06/2022 22:23:01 PAGE 2
C51 COMPILER V9.56.0.0 LCD 04/08/2022 02:58:55 PAGE 2
56 1 Lcd1602_Write_Cmd(X); //发命令字
57 1 Lcd1602_Write_Data(DData); //发数据

BIN
lcd.OBJ

Binary file not shown.

342
main.LST

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
C51 COMPILER V9.56.0.0 MAIN 04/06/2022 23:54:42 PAGE 1
C51 COMPILER V9.56.0.0 MAIN 04/08/2022 03:21:37 PAGE 1
C51 COMPILER V9.56.0.0, COMPILATION OF MODULE MAIN
@ -13,135 +13,235 @@ line level source @@ -13,135 +13,235 @@ line level source
4 #include "pwm.h"
5 #include "i2c.h"
6 #include "IRIN.h"
7
8 unsigned char PuZh[]=" Pechin Science ";
9 extern uint journey;
10 extern uint money;
11 extern uchar sudu;
12 unsigned int b12;
13 unsigned int c12;
14
15
16 unsigned int b123;
17 unsigned int c123;
18 extern unsigned char pwm_left;
19 unsigned char code ASCII[15] = {'0','1','2','3','4','5','6','7','8','9','.','-','M'};
20
21 void delayms(unsigned int ms)
22 {
23 1 unsigned char i=100,j;
24 1 for(;ms;ms--)
25 1 {
26 2 while(--i)
27 2 {
28 3 j=10;
29 3 while(--j);
30 3 }
31 2 }
32 1 }
7 #include <string.h>
8 #include <stdio.h>
9 # include <stdlib.h>
10
11 #define uint unsigned int
12 #define uchar unsigned char
13
14 typedef unsigned char uint8;
15 typedef unsigned int uint16;
16
17 extern uint mileage;
18 extern uint speed;
19
20 uint model = 0;
21
22 extern unsigned char pwm_value;
23
24
25 struct UserInfo{
26 int height;
27 int weight;
28 int target_mileage;
29 int target_speed;
30 };
31
32 uchar set = 0;
33
34 void Uart_Init() //使用定时器1作为波特率发生器(STC89C52、STC89C51、AT89C51
-等均可)
35 {
36 1 TMOD = 0x20 | 0x01;
37 1
38 1 SCON = 0x50; //设置串行方式
39 1
40 1 TH1 = 0xFD; //波特率9600
41 1
42 1 TL1 = TH1;
43 1
44 1 PCON = 0x00;
45 1
46 1 EA = 1; //总中断打开
47 1
48 1 ES = 1; //开串口中断
49 1
50 1 TR1 = 1; //启动定时器1
51 1
52 1 }
53
54 void us_delay(uchar t)
C51 COMPILER V9.56.0.0 MAIN 04/06/2022 23:54:42 PAGE 2
34 struct UserInfo usr;
35
36 /*****************相关变量**************/
37
38 uchar Receive;
39 uchar Recive_table[40]; //用于接收wifi模块反馈到MCU上的数据
40
41 bit accept = 0;
42
43 void delayms(unsigned int ms)
44 {
45 1 unsigned char i=100,j;
46 1 for(;ms;ms--)
47 1 {
48 2 while(--i)
49 2 {
50 3 j=10;
51 3 while(--j);
52 3 }
53 2 }
54 1 }
55
56 {
57 1
58 1 while(t--);
59 1
60 1 }
61
62 void Send_Uart(uchar value)
63
64 {
65 1
66 1 ES=0; //关闭串口中断
67 1
68 1 TI=0; //清发送完毕中断请求标志位
69 1
70 1 SBUF=value; //发送
71 1
72 1 while(TI==0); //等待发送完毕
73 1
74 1 TI=0; //清发送完毕中断请求标志位
75 1
76 1 ES=1; //允许串口中断
77 1
78 1 }
79
80 void ESP8266_Set(uchar *puf) // 数组指针*puf指向字符串数组
81
82 {
83 1
84 1 while(*puf!='\0') //遇到空格跳出循环
85 1
86 1 {
87 2
88 2 Send_Uart(*puf); //向WIFI模块发送控制指令。
89 2
90 2 us_delay(5);
91 2
92 2 puf++;
93 2
94 2 }
95 1
96 1 }
97
98 void main(void)
99 {
100 1 int i = 0;
101 1 InitLcd1602();
102 1 IRIN_Init();
103 1 Uart_Init();
104 1 pwm_left=10;
105 1 b12=At24c02Read(1);
106 1 c12=At24c02Read(8);
107 1 money = 120;
108 1 money=At24c02Read(5);
109 1 journey = (b12<<8)|c12;
110 1
111 1 while(1)
112 1 {
113 2 run();
114 2 ESP8266_Set("1111\r\n");
115 2 display();
116 2 keypros();
C51 COMPILER V9.56.0.0 MAIN 04/06/2022 23:54:42 PAGE 3
C51 COMPILER V9.56.0.0 MAIN 04/08/2022 03:21:37 PAGE 2
56 void Uart_Init()
57 {
58 1 TMOD = 0x20 | 0x01;
59 1 SCON = 0x50;
60 1 TH1 = 0xFD;
61 1 TL1 = TH1;
62 1 PCON = 0x00;
63 1 EA = 1;
64 1 ES = 1;
65 1 TR1 = 1;
66 1 }
67
68 void us_delay(uchar t)
69 {
70 1 while(t--);
71 1 }
72
73 void Send_Uart(uchar value)
74 {
75 1 ES=0;
76 1 TI=0;
77 1 SBUF=value;
78 1 while(TI==0);
79 1 TI=0;
80 1 ES=1;
81 1 }
82
83 void Bluetooth_Set(uchar *puf)
84 {
85 1 while(*puf!='\0')
86 1 {
87 2 Send_Uart(*puf);
88 2 us_delay(5);
89 2 puf++;
90 2 }
91 1 }
92
93
94 void saveUserInfo(){
95 1 int target = 0;
96 1 target = usr.height >> 8;
97 1 At24c02Write(3, target);
98 1 delayms(2);
99 1 target = (usr.height) & 0x00ff;
100 1 At24c02Write(4, target);
101 1 delayms(2);
102 1 target = (usr.weight) >> 8;
103 1 At24c02Write(5, target);
104 1 delayms(2);
105 1 target = (usr.weight) & 0x00ff;
106 1 At24c02Write(6, target);
107 1 delayms(2);
108 1 }
109
110
111 void Bluetooth_Accept(){
112 1 int target1 = 0, target2 = 0, i = 0;
113 1 if(accept){
114 2 if(strstr(Recive_table, "inquire") != NULL){
115 3 memset(Recive_table, 0, sizeof(Recive_table));
116 3 sprintf(Recive_table, "speed:%d km/h mileage:%d m\r\n",speed, mileage);
117 3 Bluetooth_Set(Recive_table);
C51 COMPILER V9.56.0.0 MAIN 04/08/2022 03:21:37 PAGE 3
118 3 }else if(strstr(Recive_table, "set:") != NULL){
119 3 target1 = strstr(Recive_table, "(") - Recive_table;
120 3 target2 = strstr(Recive_table, ",") - Recive_table;
121 3 usr.height = 0;
122 3 for(i = target1 + 1; i < target2; i++){
123 4 usr.height = usr.height * 10 + (*(Recive_table + i) - 0x30);
124 4 }
125 3 Bluetooth_Set(Recive_table);
126 3 target1 = strstr(Recive_table, ",") - Recive_table;
127 3 target2 = strstr(Recive_table, ")") - Recive_table;
128 3 usr.weight = 0;
129 3 for(i = target1 + 1; i < target2; i++){
130 4 usr.weight = usr.weight * 10 + (*(Recive_table + i) - 0x30);
131 4 }
132 3 memset(Recive_table, 0, sizeof(Recive_table));
133 3 sprintf(Recive_table, "SET OK\r\n",usr.height, usr.weight);
134 3 Bluetooth_Set(Recive_table);
135 3
136 3 // 计算
137 3 usr.target_mileage = (usr.weight / usr.height) * (usr.weight / usr.height) / 22 * 3000;
138 3 usr.target_speed = 10 - (usr.weight / usr.height) * (usr.weight / usr.height) / 22 ;
139 3 saveUserInfo();
140 3 }
141 2 memset(Recive_table, 0, sizeof(Recive_table));
142 2 accept = 0;
143 2 }
144 1 }
145
146 void ReadData(){
147 1 mileage = At24c02Read(1) * 255 + At24c02Read(2);
148 1 set = At24c02Read(7);
149 1 if(set){
150 2 usr.height = 0;
151 2 usr.weight = 0;
152 2
153 2 At24c02Write(1, 0);
154 2 delayms(2);
155 2 At24c02Write(2, 0);
156 2 delayms(2);
157 2
158 2 At24c02Write(3, 0);
159 2 delayms(2);
160 2 At24c02Write(4, 0);
161 2 delayms(2);
162 2 At24c02Write(5, 0);
163 2 delayms(2);
164 2 At24c02Write(6, 0);
165 2
166 2 }else{
167 2 usr.height = At24c02Read(3) * 255 + At24c02Read(4);
168 2 usr.weight = At24c02Read(5) * 255 + At24c02Read(6);
169 2 }
170 1 }
171
172
173
174
175
176 void WriteData(){
177 1 int target = mileage >> 8;
178 1 At24c02Write(1, target);
179 1 delayms(2);
C51 COMPILER V9.56.0.0 MAIN 04/08/2022 03:21:37 PAGE 4
117 2 Delay10us();
*** WARNING C206 IN LINE 117 OF main.c: 'Delay10us': missing function-prototype
118 2 }
119 1 }
180 1 target = mileage & 0x00ff;
181 1 At24c02Write(2, target);
182 1 delayms(2);
183 1 }
184
185 void main(void)
186 {
187 1 InitLcd1602();
188 1 IRIN_Init();
189 1 Uart_Init();
190 1 ReadData();
191 1 while(1)
192 1 {
193 2 run();
194 2 display();
195 2 Key_scan();
*** WARNING C206 IN LINE 195 OF main.c: 'Key_scan': missing function-prototype
196 2 Bluetooth_Accept();
197 2 WriteData();
198 2 }
199 1 }
200
201 void Uart_Interrupt() interrupt 4
202 {
203 1 static uchar i=0;
204 1 if( accept) return;
205 1 if(RI==1) {
206 2 RI=0;
207 2 Receive=SBUF; //MCU接收wifi模块反馈回来的数据
-
208 2 Recive_table[i]=Receive;
209 2 if((Recive_table[i]=='\r')){
210 3 i=0;
211 3 accept = 1;
212 3 }
213 2 else i++; //遇到换行 重
-新装值
214 2 }
215 1 else TI=0;
216 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 179 ----
CONSTANT SIZE = 22 ----
CODE SIZE = 1000 ----
CONSTANT SIZE = 57 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 25 2
DATA SIZE = 53 6
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
BIT SIZE = 1 ----
END OF MODULE INFORMATION.

BIN
main.OBJ

Binary file not shown.

223
main.c

@ -4,19 +4,41 @@ @@ -4,19 +4,41 @@
#include "pwm.h"
#include "i2c.h"
#include "IRIN.h"
#include <string.h>
#include <stdio.h>
# include <stdlib.h>
unsigned char PuZh[]=" Pechin Science ";
extern uint journey;
extern uint money;
extern uchar sudu;
unsigned int b12;
unsigned int c12;
#define uint unsigned int
#define uchar unsigned char
typedef unsigned char uint8;
typedef unsigned int uint16;
unsigned int b123;
unsigned int c123;
extern unsigned char pwm_left;
unsigned char code ASCII[15] = {'0','1','2','3','4','5','6','7','8','9','.','-','M'};
extern uint mileage;
extern uint speed;
uint model = 0;
extern unsigned char pwm_value;
struct UserInfo{
int height;
int weight;
int target_mileage;
int target_speed;
};
uchar set = 0;
struct UserInfo usr;
/*****************相关变量**************/
uchar Receive;
uchar Recive_table[40]; //用于接收wifi模块反馈到MCU上的数据
bit accept = 0;
void delayms(unsigned int ms)
{
@ -31,89 +53,164 @@ void delayms(unsigned int ms) @@ -31,89 +53,164 @@ void delayms(unsigned int ms)
}
}
void Uart_Init() //使用定时器1作为波特率发生器(STC89C52、STC89C51、AT89C51等均可)
void Uart_Init()
{
TMOD = 0x20 | 0x01;
SCON = 0x50; //设置串行方式
TH1 = 0xFD; //波特率9600
TL1 = TH1;
PCON = 0x00;
EA = 1; //总中断打开
ES = 1; //开串口中断
TR1 = 1; //启动定时器1
TMOD = 0x20 | 0x01;
SCON = 0x50;
TH1 = 0xFD;
TL1 = TH1;
PCON = 0x00;
EA = 1;
ES = 1;
TR1 = 1;
}
void us_delay(uchar t)
{
while(t--);
while(t--);
}
void Send_Uart(uchar value)
{
ES=0;
TI=0;
SBUF=value;
while(TI==0);
TI=0;
ES=1;
}
ES=0; //关闭串口中断
TI=0; //清发送完毕中断请求标志位
SBUF=value; //发送
while(TI==0); //等待发送完毕
TI=0; //清发送完毕中断请求标志位
void Bluetooth_Set(uchar *puf)
{
while(*puf!='\0')
{
Send_Uart(*puf);
us_delay(5);
puf++;
}
}
ES=1; //允许串口中断
}
void saveUserInfo(){
int target = 0;
target = usr.height >> 8;
At24c02Write(3, target);
delayms(2);
target = (usr.height) & 0x00ff;
At24c02Write(4, target);
delayms(2);
target = (usr.weight) >> 8;
At24c02Write(5, target);
delayms(2);
target = (usr.weight) & 0x00ff;
At24c02Write(6, target);
delayms(2);
}
void ESP8266_Set(uchar *puf) // 数组指针*puf指向字符串数组
{
void Bluetooth_Accept(){
int target1 = 0, target2 = 0, i = 0;
if(accept){
if(strstr(Recive_table, "inquire") != NULL){
memset(Recive_table, 0, sizeof(Recive_table));
sprintf(Recive_table, "speed:%d km/h mileage:%d m\r\n",speed, mileage);
Bluetooth_Set(Recive_table);
}else if(strstr(Recive_table, "set:") != NULL){
target1 = strstr(Recive_table, "(") - Recive_table;
target2 = strstr(Recive_table, ",") - Recive_table;
usr.height = 0;
for(i = target1 + 1; i < target2; i++){
usr.height = usr.height * 10 + (*(Recive_table + i) - 0x30);
}
Bluetooth_Set(Recive_table);
target1 = strstr(Recive_table, ",") - Recive_table;
target2 = strstr(Recive_table, ")") - Recive_table;
usr.weight = 0;
for(i = target1 + 1; i < target2; i++){
usr.weight = usr.weight * 10 + (*(Recive_table + i) - 0x30);
}
memset(Recive_table, 0, sizeof(Recive_table));
sprintf(Recive_table, "SET OK\r\n",usr.height, usr.weight);
Bluetooth_Set(Recive_table);
// 计算
usr.target_mileage = (usr.weight / usr.height) * (usr.weight / usr.height) / 22 * 3000;
usr.target_speed = 10 - (usr.weight / usr.height) * (usr.weight / usr.height) / 22 ;
saveUserInfo();
}
memset(Recive_table, 0, sizeof(Recive_table));
accept = 0;
}
}
while(*puf!='\0') //遇到空格跳出循环
void ReadData(){
mileage = At24c02Read(1) * 255 + At24c02Read(2);
set = At24c02Read(7);
if(set){
usr.height = 0;
usr.weight = 0;
At24c02Write(1, 0);
delayms(2);
At24c02Write(2, 0);
delayms(2);
At24c02Write(3, 0);
delayms(2);
At24c02Write(4, 0);
delayms(2);
At24c02Write(5, 0);
delayms(2);
At24c02Write(6, 0);
}else{
usr.height = At24c02Read(3) * 255 + At24c02Read(4);
usr.weight = At24c02Read(5) * 255 + At24c02Read(6);
}
}
{
Send_Uart(*puf); //向WIFI模块发送控制指令。
us_delay(5);
puf++;
}
void WriteData(){
int target = mileage >> 8;
At24c02Write(1, target);
delayms(2);
target = mileage & 0x00ff;
At24c02Write(2, target);
delayms(2);
}
void main(void)
{
int i = 0;
InitLcd1602();
IRIN_Init();
Uart_Init();
pwm_left=10;
b12=At24c02Read(1);
c12=At24c02Read(8);
money = 120;
money=At24c02Read(5);
journey = (b12<<8)|c12;
ReadData();
while(1)
{
run();
ESP8266_Set("1111\r\n");
display();
keypros();
Delay10us();
Key_scan();
Bluetooth_Accept();
WriteData();
}
}
void Uart_Interrupt() interrupt 4
{
static uchar i=0;
if( accept) return;
if(RI==1) {
RI=0;
Receive=SBUF; //MCU接收wifi模块反馈回来的数据
Recive_table[i]=Receive;
if((Recive_table[i]=='\r')){
i=0;
accept = 1;
}
else i++; //遇到换行 重新装值
}
else TI=0;
}

BIN
pro

Binary file not shown.

1392
pro.M51

File diff suppressed because it is too large Load Diff

7
pro.build_log.htm

@ -23,11 +23,12 @@ Project File Date: 05/31/2019 @@ -23,11 +23,12 @@ Project File Date: 05/31/2019
<h2>Output:</h2>
Build target 'Target 1'
compiling IRIN.c...
compiling main.c...
main.c(195): warning C206: 'Key_scan': missing function-prototype
linking...
Program Size: data=71.5 xdata=0 code=2992
Program Size: data=111.3 xdata=0 code=5315
creating hex file from "pro"...
"pro" - 0 Error(s), 0 Warning(s).
"pro" - 0 Error(s), 1 Warning(s).
Build Time Elapsed: 00:00:01
</pre>
</body>

597
pro.hex

@ -1,223 +1,378 @@ @@ -1,223 +1,378 @@
:100A9E00313131310D0A0030313233343536373899
:060AAE00392E2D4D000061
:1008A90011212050656368696E20536369656E6321
:0308B900652000B7
:100A3D007C64EF4E60131CEC60087D0A1DED60F6C2
:090A4D0080FAEF1F70EC1E80E935
:010A5600227D
:100A8800758921759850758DFD858D8BE4F587D214
:060A9800AFD2ACD28E22A9
:10119800696E71756972650073706565643A256476
:1011A800206B6D2F68206D696C656167653A2564F1
:1011B800206D0D0A007365743A0028002C00290080
:0911C800534554204F4B0D0A0061
:0C12090002230000014E00C10901220078
:04135E007F027E008C
:101362007C64EF4E60131CEC60087D0A1DED60F694
:0913720080FAEF1F70EC1E80E907
:01137B00224F
:10140700758921759850758DFD858D8BE4F587D28B
:06141700AFD2ACD28E2220
:07000300AE071FEE70FA22A8
:0E0B7200C2ACC2998F993099FDC299D2AC22C3
:100A700012037BFF6011120B727F051200037401D9
:080A800029F9E43AFA80E922A9
:10085300E4F50FF510120ACA120ADE120A88750BA4
:100863000A7F011209867532008F337F08120986C9
:100873007534008F357542007543787F05120986FC
:100883007542008F43E5334534F53AE535F53B12C0
:100893000B367BFF7A0A799E120A7012040912073B
:0608A300EC120B8580E958
:100AF20075A0FFC287D286D285AFA0C285EF20E75C
:010B0200F6FC
:010B030022CF
:100B1600AE07120AF2C287C2868EA0D285C285228D
:100B2600AE07120AF2D287C2868EA0D285C285226D
:100B0400ED7004AC078004EF2440FCEC4480FF0249
:020B14000B16BE
:100A0400AE07AC0353050153060FED6003430640E4
:0D0A1400430680AF06120B16AF04020B263E
:100938008B118A128913120B04AB11AA12A9131274
:10094800037B60130513E5137002051214F91203F3
:080958007BFF120B2680E22256
:100ACA007F38120B167F0C120B167F06120B167F3D
:040ADA0001020B16F4
:1008BC00010800010D00010E00010C00010B00C12C
:0708CC0083C1840209000052
:1009A800E4FDFCC3ED9FEC9E5015E4FBFA0BBB0085
:0F09B800010ABA07F8BBD0F50DBD00010C80E4B1
:0109C700220D
:0F0B3600750D03850B0CC286D287D284C285222F
:0F0B4500750D03750C04D286C287C284D2852237
:0B0B9B00E4F50D750C04D284C2852225
:0B0BA600E4F50C750D04C286D2872216
:1009C800300418E508D3950D5004D2B58002C2B59D
:0E09D800E508C394144006E4F50822C2B522D7
:1009E600300318E50ED3950C5004D2B48002C2B47D
:0E09F600E50EC394144006E4F50E22C2B422AE
:03001B00020A21B5
:100A2100C0E0C0D0758DFC758B18050AE50A70020F
:0C0A31000509050E1209E6D0D0D0E03215
:050B8000120B85D2817B
:080B85007F017E02DEFEDFFAB3
:010B8D002245
:0F0B5400D280120B80C280120B85C281020B85EA
:0A0BB100C280120B80D280020B8577
:0208F700AD074B
:1008F900E4FBFAEDC4131313540124FF9280ED2590
:10090900E0FD120B80C281120B850BBB08E5D2807A
:10091900120B85D28130800F0AEAD394C840F6C2FF
:0E09290081120B857F0022C281120B857F0197
:01093700229D
:10096000E4FDFCD280120B85D281120B85EC25E0D0
:10097000FCA280E4334204120B85C281120B850D68
:05098000BD08E5AF0415
:01098500224F
:100A5700AC05A907120B547FA01208F7AF011208C3
:090A6700F7AF041208F7020BB10D
:02098600AC07BC
:10098800120B547FA01208F7AF041208F7120B5489
:0F0998007FA11208F7120960AD07120BB1AF056E
:0109A700222D
:100AB40053706565643A004B4D2F68004C3A004D05
:060AC40000513A002E0073
:1008D300024200070249000002440000014D0002E9
:1008E3003C0000024B0000C101C100C102014600EF
:0308F300015200AF
:040B63007FE87E03A6
:0B0B6700EF1FAC0670011E4C70F62260
:100ADE00758921758C3C758AB0D2A9D28CD2AFD2D1
:040AEE00AAD28A22DC
:100409003001030205F27F0A1209867549008F4AF5
:10041900D3E5439407E5429400400A7F0512098613
:100429007542008F43E4FDFF120B047BFF7A0A79C2
:10043900B4E4FDFF120938AE49AF4A7C007D64126D
:1004490003A67C007D0A1203A6ED2430FF120B26B9
:10045900AE49AF4A7C007D0A1203A67C007D0A12D0
:1004690003A6ED2430FF120B26AE49AF4A7C007D6E
:100479000A1203A6ED2430FF120B267BFF7A0A79B4
:10048900BBE4FD7F0A1209387BFF7A0A79C07D0136
:10049900E4FF120938AE3AAF3B7C277D101203A660
:1004A9007C007D0A1203A6ED2430FF120B26AE3A1A
:1004B900AF3B7C037DE81203A67C007D0A1203A6EC
:1004C900ED2430FF120B26AE3AAF3B7C007D64125F
:1004D90003A67C007D0A1203A6ED2430FF120B2629
:1004E900AE3AAF3B7C007D0A1203A67C007D0A125E
:1004F90003A6ED2430FF120B26AE3AAF3B7C007DFC
:100509000A1203A6ED2430FF120B267BFF7A0A7923
:10051900C37D017F07120938D3E53B94E8E53A9496
:10052900034031E53B2418FDE53A34FCFCE41202B2
:10053900C17B6F7A127903783B120116E4FBFA79D1
:10054900E078401200251202FA8E428F43AD437FB4
:1005590005120A57AE42AF437C007D0A1203948EFE
:10056900428F437BFF7A0A79C57D017F09120938D9
:10057900AE42AF437C037DE81203A67C007D0A12DC
:1005890003A6ED2430FF120B26AE42AF437C007D5B
:10059900641203A67C007D0A1203A6ED2430FF1223
:1005A9000B26AE42AF437C007D0A1203A67C007D78
:1005B9000A1203A6ED2430FF120B267BFF7A0A7973
:1005C900C87D017F0E120938AE42AF437C007D0A17
:1005D9001203A6ED2430FF120B26AE42AF437C0076
:0A05E9007D0A1203A68E428F432202
:1007EC0020B43B120B6320B4327F0A120986754980
:1007FC00008F4A7F01120986753E008F3F7F0812D9
:10080C0009867540008F41E53F4540F53AE541F5D5
:10081C003B7F051209867542008F4330B4FD20B52D
:10082C000B120B6320B502D20230B5FD20B21712A9
:10083C000B6320B20EE50BC394144005750B0180BD
:07084C0002050B30B2FD2292
:03000B000205F3F8
:1005F300C0E0C0F0C083C082C0D075D000C000C0CE
:1006030001C002C003C004C005C006C007758C3C0E
:10061300758AB0054DE54D75F00584E5F07002B2BD
:1006230000E54D75F00A84E5F06003020745E546F1
:1006330060021546E55260021552754D00C2AA8547
:10064300444B85454C754400754500D2AAAE4BAF6B
:100653004C7C007D06120394AC06AD07E41202C184
:10066300E4FBFAF9783F120116C004C005C006C0C6
:1006730007AC3CAD3DE41202C1E4FBFAF9783F124A
:100683000116D003D002D001D0001200251202FAC5
:100693008E3C8F3D300203020722AC3CAD3DE41299
:1006A30002C17B9A7A997919783E1201161202FADD
:1006B3008E498F4AAD4A7F0A120A57AC4BAD4CE4C0
:1006C3001202C1E4FBFA79207840120116E4FBFA26
:1006D30079A0784112021FC004C005C006C007AC50
:1006E3003AAD3BE41202C1D003D002D001D00012D4
:1006F30000251202FA8E3A8F3B853A47853B4875AF
:100703005000853B51AD517F08120A57120B63E528
:1007130047F54F754E00AD4F7F01120A5780237581
:100723003A00753B00754200754307AD3B7F0112EC
:100733000A57AD3B7F08120A57AD437F05120A578C
:10074300C202D007D006D005D004D003D002D00116
:0D075300D000D0D0D082D083D0F0D0E032E2
:03001300020B8E4F
:0D0B8E00C0E00545E54570020544D0E032A9
:10001E00020366E86480F8E933E83360110460F0A7
:10002E00ED33EC337009E8FCE9FDEAFEEBFF220448
:10003E0060DED3EB9FEA9EE99DE8C2E78CF0C2F743
:10004E0095F0400CE8CCF8E9CDF9EACEFAEBCFFB0F
:10005E0012033185D0F05804700320D5B3E8047034
:10006E00075002B2D502037092D5EC0460F7E4CCCF
:10007E00C0E0C398F8603B94186008400DD0E0FBD8
:10008E00020348E4FBFAC9FC8028E830E406E4C920
:10009E00FBE4CAFCE830E305E4C9CACBFCE854072C
:1000AE006010F8C3E913F9EA13FAEB13FBEC13FC37
:1000BE00D8F130F52FC3E49CFCEF9BFFEE9AFEEDDA
:1000CE0099FDD0E0FBEF4E4D4C701222DB03020384
:1000DE006DEC2CFCEF33FFEE33FEED33FDED30E730
:1000EE00EB020348EF2BFFEE3AFEED39FDD0E0FBBD
:1000FE0050130BBB0003020370ED13FDEE13FEEF66
:08010E0013FFEC13FC0203488F
:10011600EC4D6011E8497017ED33EC3304600DE4E3
:10012600FCFFFEFD22E933E8330470F80203661291
:10013600033158046009E4CC248150062850090292
:10014600037028400302036DC0E0EB4A7044B98097
:1001560006D0E0FB02035CEF4E701CBD8008EBFF8F
:10016600EAFEE9FD80EBE98DF0A4FEE5F00201FF71
:10017600E9CDF9EAFEEBFFEF89F0A4FCE5F0CE89C4
:10018600F0A42EFFE435F0CD89F0A42DFEE435F081
:100196008067EF4E7005BD80D780C3EF8BF0A4ACAF
:1001A600F0EE8BF0A42CFCE435F0F8EF8AF0A42CEA
:1001B600E5F038FCE433CB8DF0A42CFCE5F03BF8FD
:1001C600EE8AF0A42CFCE5F038F8E433CF89F0A4ED
:1001D6002CFCE5F038CF3400CE89F0A42FFFE5F0F3
:1001E6003EFEE433C98DF0A42EFEE5F039CD8AF04B
:1001F600A42FFFE5F03EFEE43DFD33D0E0FB5007C3
:100206000BBB000F020370EC2CFCEF33FFEE33FE4A
:06021600ED33FD02034878
:10021C00020370EC5D046005E85904700302036688
:10022C00120331580460F6EC4860F2EC7004FDFEE9
:10023C00FF22C860DB2481C85009C39860025006B5
:10024C0002036D9850CAF582E9294B4A7005AB82BE
:10025C0002035C75F0007C1A7880C3EF9BEE9AED7C
:10026C0099400DC3EF9BFFEE9AFEED99FDE842F02D
:10027C00DC23ACF0D0E0FFD0E0FED0E0FDAB822080
:10028C00E7101BEB60BAEC2CFCEF33FFEE33FEED0A
:10029C0033FD020348E803F830E705C0F075F000C1
:1002AC00EF2FFFEE33FEED33FD40B830E7C280AAEE
:1002BC0075F020800E75F010800575F0087D007EBD
:1002CC00007F003392D530D5031203FBEC33401082
:1002DC00EF33FFEE33FEED33FDEC33FCD5F0ED22C6
:0E02EC00E5F0247EA2D513CC92E7CDCEFF2202
:1002FA00EDD2E7CD33EC3392D524814006E4FFFEFC
:10030A00FDFC22FCE4CFCECDCC24E0501174FF805A
:10031A00EDC3CC13CCCD13CDCE13CECF13CF0470F7
:07032A00F030D5DE0203FBF9
:10033100E9D2E7C933E833F892D5EDD2E7CD33EC12
:0703410033FC5002B2D5228B
:10034800EC30E7100FBF000C0EBE00080DBD000416
:100358000BEB6014A2D5EB13FCED92E7FD2274FFC2
:10036800FCFDFEFF22E480F8A2D574FF13FC7D801B
:03037800E480EF2F
:0300000002076094
:0C076000787FE4F6D8FD7581520207A7EF
:10037B00BB010689828A83E0225002E722BBFE0280
:09038B00E32289828A83E49322B3
:10039400EF8DF0A4A8F0CF8CF0A428CE8DF0A42E7D
:0203A400FE2237
:1003A600BC000BBE0029EF8DF084FFADF022E4CC3B
:1003B600F875F008EF2FFFEE33FEEC33FCEE9DEC04
:1003C600984005FCEE9DFE0FD5F0E9E4CEFD22ED4A
:1003D600F8F5F0EE8420D21CFEADF075F008EF2F94
:1003E600FFED33FD4007985006D5F0F222C398FD85
:0503F6000FD5F0EA2222
:0E03FB00C3E49FFFE49EFEE49DFDE49CFC2213
:10076C00020853E493A3F8E493A34003F68001F248
:10077C0008DFF48029E493A3F85407240CC8C3338E
:10078C00C4540F4420C8834004F456800146F6DF5D
:10079C00E4800B01020408102040809008A9E47E3C
:1007AC00019360BCA3FF543F30E509541FFEE49352
:1007BC00A360010ECF54C025E060A840B8E493A319
:1007CC00FAE493A3F8E493A3C8C582C8CAC583CA44
:1007DC00F0A3C8C582C8CAC583CADFE9DEE780BEFC
:0108F6000001
:0E149800C2ACC2998F993099FDC299D2AC2294
:06137C007B007A007926D7
:10138200120525FF60111214987F051200037401E3
:0813920029F9E43AFA80E9228E
:1010DB00E54FFF3395E0FEAD077F031213EE1213BE
:1010EB005E7E00AF50AD077F041213EE12135EE568
:1010FB0051FF3395E0FEAD077F051213EE12135E21
:10110B007E00AF52AD077F061213EE7F027E000208
:02111B0013625D
:100AF900E4F557F558F559F55AF55BF55C20090306
:100B0900020D0D7560FF756111756298FB7A0079A8
:100B190026121059E94A4B60337E007F287D007BFD
:100B2900007A00792612065E7560FF75611175629B
:100B3900A0850A63850B648510658511667B007A3B
:100B49000079261206E612137C020CFC7560FF750B
:100B590061117562BD7B007A007926121059E94A44
:100B69004B7003020CFC7560FF7561117562C27BE5
:100B7900007A007926121059AE02C3E99426F55875
:100B8900EE9400F5577560FF7561117562C47B00BD
:100B99007A007926121059AE02C3E99426F55AEE65
:100BA9009400F559E4F54FF550E5582401F55CE456
:100BB9003557F55BC3E55C955AE5596480F8E55B03
:100BC900648098502A7426255CF8E624D0FBE43426
:100BD900FFFAAE4FAF507C007D0A12057DEF2BF571
:100BE90050EE3AF54F055CE55C7002055B80C51275
:100BF900137C7560FF7561117562C47A00792612DC
:100C09001059AE02C3E99426F558EE9400F55775CC
:100C190060FF7561117562C67B007A007926121032
:100C290059AE02C3E99426F55AEE9400F559E4F554
:100C390051F552E5582401F55CE43557F55BC3E5F8
:100C49005C955AE5596480F8E55B648098502A748C
:100C590026255CF8E624D0FBE434FFFAAE51AF5206
:100C69007C007D0A12057DEF2BF552EE3AF5510510
:100C79005CE55C7002055B80C57E007F287D007B9A
:100C8900007A00792612065E7560FF75611175623A
:100C9900C8854F638550648551658552667B007AA6
:100CA9000079261206E612137CAC4FAD50AE51AF57
:100CB900521205E4AC06AD0712057D7C007D1612C3
:100CC90005E47C0B7DB812057D8E538F54AC4FAD76
:100CD90050AE51AF521205E4AC06AD0712057D7C4A
:100CE900007D161205E4C3740A9FF556E49EF55576
:100CF9001210DB7E007F287D007B007A00792612A6
:040D0900065EC209B7
:010D0D0022C3
:100F17007F011212DCEF75F0FFA4FFAEF0C006C030
:100F2700077F021212DCEFFDD0E02DF511D0E0347F
:100F370000F5107F071212DC8F4EE54E6041E4F595
:100F47004FF550F551F552FD7F011213EE12135E66
:100F5700E4FD7F021213EE12135EE4FD7F0312130A
:100F6700EE12135EE4FD7F041213EE12135EE4FD2E
:100F77007F051213EE12135EE4FD7F060213EE7F68
:100F8700031212DCEF75F0FFA4FFAEF0C006C00736
:100F97007F041212DCEFFDD0E02DF550D0E03400D5
:100FA700F54F7F051212DCEF75F0FFA4FFAEF0C01E
:100FB70006C0077F061212DCEFFDD0E02DF552D0F8
:060FC700E03400F55122A8
:10133F00E5107E00FD7F011213EE12135E7E00AFEB
:0F134F0011AD077F021213EE7F027E00021362C0
:10139A0012141D121431121407120F1712123812D6
:0D13AA000E1C12115E120AF912133F80EFA3
:030023000211D1F6
:0911D100C0E0C0D075D000C000E0
:1011DA00200925309820C29885992574262522F859
:1011EA00A62574262522F8E6B40D07752200D20931
:0811FA00800605228002C29963
:07120200D000D0D0D0E03293
:1014450075A0FFC287D286D285AFA0C285EF20E7FF
:01145500F6A0
:011456002273
:10146900AE07121445C287C2868EA0D285C28522D4
:10147900AE07121445D287C2868EA0D285C28522B4
:10145700ED7004AC078004EF2440FCEC4480FF02ED
:02146700146906
:1013B700AE07AC0353050153060FED600343064028
:0D13C700430680AF06121469AF04021479CA
:101267008B578A588959121457AB57AA58A959123C
:10127700052560130559E5597002055814F912053B
:0812870025FF12147980E22218
:10141D007F381214697F0C1214697F061214697FCC
:04142D00010214693B
:0B121500011500011400011300C10AC4
:10131F00E4FDFCC3ED9FEC9E5015E4FBFA0BBB0004
:0F132F00010ABA07F8BBD0F50DBD00010C80E430
:01133E00228C
:10123800E52445237004F513801DE5246401452346
:1012480070057513028010E5246402452370057546
:0F1258001305800375130A851314C290D29122D7
:1012FE000515A20AB35017E51595145004D2B48003
:10130E0002C2B4E515C394144006E4F51522C2B426
:01131E0022AC
:0514A6001214ABD2811D
:0814AB007F017E02DEFEDFFA84
:0114B3002216
:0F148900D2801214A6C2801214ABC2810214AB1F
:0A14BF00C2801214A6D2800214AB02
:02111D00AD071C
:10111F00E4FBFAEDC4131313540124FF9280ED2561
:10112F00E0FD1214A6C2811214AB0BBB08E5D280EE
:10113F001214ABD28130800F0AEAD394C840F6C2A2
:0E114F00811214AB7F0022C2811214AB7F010B
:01115D00226F
:1012B600E4FDFCD2801214ABD2811214ABEC25E013
:1012C600FCA280E43342041214ABC2811214AB0DAB
:0512D600BD08E5AF04B6
:0112DB0022F0
:1013EE00AC05A9071214897FA012111DAF011211AD
:0913FE001DAF0412111D0214BF01
:0212DC00AC075D
:1012DE001214897FA012111DAF0412111D12148950
:0F12EE007FA112111D1212B6AD071214BFAF056A
:0112FD0022CE
:1013D400004B4D2F6820006D20202020202020204D
:0A13E400200020004C004D004800DE
:1012200002100000020C0000011200020A0000027D
:071230000E0000020800009F
:0B14B400EF1FAC0670011E4C70F6220A
:10143100758921758CFC758A18D2A9D28CD2AFD24C
:04144100AAD28A227F
:100E1C00E4FDFF1214577BFF7A1379D4E4FDFF1223
:100E2C001267AE0AAF0B7C007D6412058F7C007DCF
:100E3C000A12058FED2430FF121479AE0AAF0B7C29
:100E4C00007D0A12058F7C007D0A12058FED24307F
:100E5C00FF121479AE0AAF0B7C007D0A12058FEDE0
:100E6C002430FF1214797BFF7A1379D5E4FD7F03CC
:100E7C001212677BFF7A1379D4E4FD7F0812126794
:100E8C00AE10AF117C007D6412058F7C007D0A12C0
:100E9C00058FED2430FF121479AE10AF117C007D5C
:100EAC000A12058F7C007D0A12058FED2430FF128B
:100EBC001479AE10AF117C007D0A12058FED243031
:100ECC00FF1214797BFF7A1379DBE4FD7F0B12128E
:100EDC0067E524452370087BFF7A1379E68025E5C6
:100EEC00246401452370087BFF7A1379E88015E5AB
:100EFC0024640245237BFF70067A1379EA80057A15
:0B0F0C001379ECE4FD7F0D1212672248
:10115E0020B5237FE87E031214B420B5160524E5CE
:10116E002470020523C39404E52394004005E4F59E
:10117E0023F52430B5FD20B2107FE87E031214B49F
:0A118E0020B203754E0130B2FD22BD
:03000B00020D0ED5
:100D0E00C0E0C0F0C083C082C0D075D000C000C0AB
:0D0D1E0001C002C003C004C005C006C0072C
:100D2B00758CFC758A180509E50970020508121205
:100D3B00FEC3E50994F4E508648094815003020E28
:100D4B0001C2AA750800750900850C0E850D0F757B
:100D5B000C00750D00D2AAAE0EAF0F7C007D0612F3
:100D6B00057DAC06AD07E41202C9E4FBFAF9783F46
:100D7B0012011EC004C005C006C007AC0AAD0BE4CF
:100D8B001202C9E4FBFAF9783F12011ED003D0021C
:100D9B00D001D00012002D1203028E0A8F0BAC0A69
:100DAB00AD0BE41202C97B9A7A997919783E12013C
:100DBB001E1203028E0A8F0BAC0EAD0FE41202C98A
:100DCB00E4FBFA7920784012011EE4FBFA79A07853
:100DDB0041120227C004C005C006C007AC10AD11FC
:100DEB00E41202C9D003D002D001D00012002D12A0
:060DFB0003028E108F11AF
:100E0100D007D006D005D004D003D002D001D00045
:0B0E1100D0D0D082D083D0F0D0E032EF
:03001300020016D2
:0D001600C0E0050DE50D7002050CD0E032D4
:1000260002036EE86480F8E933E83360110460F097
:10003600ED33EC337009E8FCE9FDEAFEEBFF220440
:1000460060DED3EB9FEA9EE99DE8C2E78CF0C2F73B
:1000560095F0400CE8CCF8E9CDF9EACEFAEBCFFB07
:1000660012033985D0F05804700320D5B3E8047024
:10007600075002B2D502037892D5EC0460F7E4CCBF
:10008600C0E0C398F8603B94186008400DD0E0FBD0
:10009600020350E4FBFAC9FC8028E830E406E4C910
:1000A600FBE4CAFCE830E305E4C9CACBFCE8540724
:1000B6006010F8C3E913F9EA13FAEB13FBEC13FC2F
:1000C600D8F130F52FC3E49CFCEF9BFFEE9AFEEDD2
:1000D60099FDD0E0FBEF4E4D4C701222DB0302037C
:1000E60075EC2CFCEF33FFEE33FEED33FDED30E720
:1000F600EB020350EF2BFFEE3AFEED39FDD0E0FBAD
:1001060050130BBB0003020378ED13FDEE13FEEF55
:0801160013FFEC13FC0203507F
:10011E00EC4D6011E8497017ED33EC3304600DE4DB
:10012E00FCFFFEFD22E933E8330470F802036E1281
:10013E00033958046009E4CC248150062850090282
:10014E000378284003020375C0E0EB4A7044B9807F
:10015E0006D0E0FB020364EF4E701CBD8008EBFF7F
:10016E00EAFEE9FD80EBE98DF0A4FEE5F002020760
:10017E00E9CDF9EAFEEBFFEF89F0A4FCE5F0CE89BC
:10018E00F0A42EFFE435F0CD89F0A42DFEE435F079
:10019E008067EF4E7005BD80D780C3EF8BF0A4ACA7
:1001AE00F0EE8BF0A42CFCE435F0F8EF8AF0A42CE2
:1001BE00E5F038FCE433CB8DF0A42CFCE5F03BF8F5
:1001CE00EE8AF0A42CFCE5F038F8E433CF89F0A4E5
:1001DE002CFCE5F038CF3400CE89F0A42FFFE5F0EB
:1001EE003EFEE433C98DF0A42EFEE5F039CD8AF043
:1001FE00A42FFFE5F03EFEE43DFD33D0E0FB5007BB
:10020E000BBB000F020378EC2CFCEF33FFEE33FE3A
:06021E00ED33FD02035068
:10022400020378EC5D046005E85904700302036E70
:10023400120339580460F6EC4860F2EC7004FDFED9
:10024400FF22C860DB2481C85009C39860025006AD
:100254000203759850CAF582E9294B4A7005AB82AE
:1002640002036475F0007C1A7880C3EF9BEE9AED6C
:1002740099400DC3EF9BFFEE9AFEED99FDE842F025
:10028400DC23ACF0D0E0FFD0E0FED0E0FDAB822078
:10029400E7101BEB60BAEC2CFCEF33FFEE33FEED02
:1002A40033FD020350E803F830E705C0F075F000B1
:1002B400EF2FFFEE33FEED33FD40B830E7C280AAE6
:1002C40075F020800E75F010800575F0087D007EB5
:1002D400007F003392D530D50312061AEC33401058
:1002E400EF33FFEE33FEED33FDEC33FCD5F0ED22BE
:0E02F400E5F0247EA2D513CC92E7CDCEFF22FA
:10030200EDD2E7CD33EC3392D524814006E4FFFEF3
:10031200FDFC22FCE4CFCECDCC24E0501174FF8052
:10032200EDC3CC13CCCD13CDCE13CECF13CF0470EF
:07033200F030D5DE02061ACF
:10068A00E5742460F8E6057422785D300702786024
:10069A00E475F0011206280205252000EB7F2ED210
:1006AA00008018EF540F2490D43440D4FF30040B48
:1006BA00EF24BFB41A0050032461FFE575600215E8
:1006CA00750578E5787002057730070D785DE47571
:1006DA00F001120628EF02056B02128F7403D2078B
:1006EA008003E4C207F5748B5D8A5E895FE4F57561
:1006FA00F577F578E57560077F201206C580F575F0
:10070A0076FFC201C200C202C203C205C206C20803
:10071A00120693FF700D3007057F001206D6AF78D8
:10072A00AE7722B4255FC2D5C204120693FF24D045
:10073A00B40A00501A75F00A787530D50508B6FF64
:10074A000106C6A426F620D5047002D20380D92455
:10075A00CFB41A00EF5004C2E5D2040209C3D20191
:10076A0080C6D20080C0D20280BCD2D580BAD2055F
:10077A0080B47F201206C52002077401B5750040B7
:10078A00F112068AFF1206C50206FED208D20680B8
:10079A009512068AFB12068AFA12068AF94A4B70E1
:1007AA000679BA7A0A7BFF20022EE575602A7E0056
:1007BA008E8275830012053E60060EEE657670F035
:1007CA00C2D5EBC0E0EAC0E0E9C0E0EE120A23D0ED
:1007DA00E0F9D0E0FAD0E0FB120525FF60AAEBC0F1
:1007EA00E0EAC0E0E9C0E01206C5D0E02401F9D091
:1007FA00E03400FAD0E0FBE5760460DCD576D980F7
:10080A0087D20280A2120A0660F7E5767001041206
:10081A000383A976600DE576600914F576120AADB0
:10082A00EF60F3EA30E702F404C3995077EAF4255B
:10083A00760430E701E404F576800D120A0660C1F9
:10084A00EA05762576120383EA7873F630E701E43F
:10085A00257604D5760420050114120A23E4C0E0A3
:10086A00120AAD7873E6601320E70714F61206AD94
:10087A00802204F6D0E014C0E07F001206ADE576CF
:10088A0060071206A41576800B3005031206A4D061
:10089A00E00206FED0E00480C5120A0660A0E576F2
:1008AA00041203837873EAF6E576200502600104F0
:0508BA002404120A23D2
:1008BF0074FF04C0E0120AAD1206ADE57620050202
:1008CF0060031206A4D0E0B576E87F451206B7782C
:1008DF0073E67F2B30E7047F2DF404C0E01206C5CA
:1008EF00D0E075F00A84C0F01206AED0E01206AE6A
:1008FF000206FE791080027908C206C2088008D26B
:10090F00D5790A8004790AC2D5E576047002F576A6
:10091F00E4FAFDFEFF12068AFC7B08200113120683
:10092F008AFD7B1030000A12068AFE12068AFF7BB0
:10093F0020EC3382D592D55013C3E43000069FFFCD
:10094F00E49EFEE42001039DFDE49CFCE4CBF8C291
:10095F0001EC700CCFCECDCCE824F8F870F38017F3
:10096F00C3EF33FFEE33FEED33FDEC33FCEB33FB24
:10097F00994002FB0FD8E9EB300105F8D0E0C448ED
:10098F00B201C0E00AEC4D4E4F78207B0070C2EAF6
:10099F00B5760040BCC0E0120A25D0F0D0E02001AF
:1009AF0004C4C0E0C4B201C0F01206AED0F0D5F05E
:1009BF00EB0206FE120638079B53090258076C4CD0
:1009CF0007684209064F090E44090E49078143097A
:1009DF00145508454608A345080F470ADA50077013
:1009EF002D07742E07972B0778230795200AC32A04
:1009FF000730480000078FE576B4FF0375760612BF
:100A0F00068AFC12068AFD12068AFE12068AFF78F3
:100A1F006C0203B2790AA2D5200314300509B9106C
:100A2F00020404B9080104A2D520060250010420D3
:100A3F0002689202B575005034C0E07F2030031970
:100A4F007F30A20272067205500F120A7CC202C2D8
:100A5F0006C205C2087F30800F300503E9C0E012DF
:100A6F0006C5300503D0E0F9D0E0B575CC300517D9
:100A7F007F30B9100C1206C57F583004077F78807D
:100A8F0003B908031206C53002057F2D0206C57F84
:100A9F00202008F87F2B2006F322920280CF7F00C0
:100AAF00B407005005246CF8E6FF22286E756C6CB5
:100ABF002900D20112068A3001F8C201787530D5AB
:100ACF000108F60207302D5043495812068A2403B5
:100ADF00B405004001E4900AD5931206B6743A1299
:0A0AEF0006B6D20375750402090271
:10033900E9D2E7C933E833F892D5EDD2E7CD33EC0A
:0703490033FC5002B2D52283
:10035000EC30E7100FBF000C0EBE00080DBD00040E
:100360000BEB6014A2D5EB13FCED92E7FD2274FFBA
:10037000FCFDFEFF22E480F8A2D574FF13FC7D8013
:03038000E480EF27
:10038300F920E72824F950037907E4F42402FB1841
:10039300DBFDE624FB5014E9600DE4F618E604F6F1
:0F03A300B40A08E4F6D9F57401F60A22C2D5228D
:1003B200ED33EC3392D5FA602AB4FF33EDC2E77B1A
:1003C200FF60067A0379D7E4227A0379E020D50424
:1003D2007A0379DB224E614E002B494E46002D49AD
:1003E2004E4600E47A08F608DAFC7B00740722E83D
:1003F200C0E0ECC0E0EDC0E0EEC0E0EFC0E0EA75C6
:10040200F010A4CAABF075F04DA42BFBE435F0FC60
:10041200EA2410FAEB34C5FBEC34D9FCEDC2E7FF59
:1004220075F056A4F42411C5F0F434C58FF0A42A53
:10043200E5F03BE43CF620E7141204E5D0E0FFD0FF
:10044200E0FED0E0FDD0E0FC1202278014F404129A
:1004520004E5D0E0FFD0E0FED0E0FDD0E0FC1201E8
:100462001ED0E0F8E6FAEDD2E7CD33EC332482FB7E
:10047200E4C3CF33CFCE33CECD33CD33DBF37B07E3
:1004820075F00A846004F6081B0AE5F0F6088FF09E
:10049200740AA4FFACF08EF0740AA42CFEACF050E7
:1004A200010C8DF0740AA42CFDE435F0F608DBDEB5
:0304B200740722AA
:1004B5003F8000004120000042C80000447A00004F
:1004C500461C400047C35000497424004B189680D1
:1004D5004CBEBC205A0E1BCA6753C21C749DC5AEC8
:1004E500FB60065407601C2323120513EB54386088
:1004F500091204FF12050E12011EECF8EDF9EEFAD1
:10050500EFCB22EB12050E80F1543803241C900426
:10051500B5FE93FC0EEE93FD0EEE930ECE93FF22E9
:03000000020FCD1F
:0C0FCD00787FE4F6D8FD758178021014DE
:10052500BB010689828A83E0225002E722BBFE02D4
:09053500E32289828A83E4932207
:10053E00BB010CE58229F582E5833AF583E0225072
:10054E0006E92582F8E622BBFE06E92582F8E222BC
:0D055E00E58229F582E5833AF583E49322D6
:10056B00BB010689828A83F0225002F722BBFE016F
:02057B00F32269
:10057D00EF8DF0A4A8F0CF8CF0A428CE8DF0A42E92
:02058D00FE224C
:10058F00BC000BBE0029EF8DF084FFADF022E4CC50
:10059F00F875F008EF2FFFEE33FEEC33FCEE9DEC19
:1005AF00984005FCEE9DFE0FD5F0E9E4CEFD22ED5F
:1005BF00F8F5F0EE8420D21CFEADF075F008EF2FA9
:1005CF00FFED33FD4007985006D5F0F222C398FD9A
:0505DF000FD5F0EA2237
:1005E400C2D5EC30E709B2D5E4C39DFDE49CFCEE32
:1005F40030E715B2D5E4C39FFFE49EFE12058FC316
:10060400E49DFDE49CFC800312058F30D507C3E410
:060614009FFFE49EFE22A0
:0E061A00C3E49FFFE49EFEE49DFDE49CFC22F1
:10062800FAE6FB0808E6F925F0F618E6CA3AF622D3
:10063800D083D082F8E4937012740193700DA3A351
:1006480093F8740193F5828883E473740293686065
:06065800EFA3A3A380DF65
:10128F00EFB40A07740D12129A740A309811A899C4
:10129F00B8130CC2983098FDA899C298B811F630BF
:0712AF0099FDC299F5992297
:101059008B5D8A5E895FAB60AA61A9621205256012
:1010690063AB5DAA5EA95F120525605F8560638534
:1010790061648562658B668A678968AB63AA64A9BE
:1010890065120525FF6023AB66AA67A968120525C5
:101099006F7017042565F565E43564F564740125F9
:1010A90068F568E43567F56780D1AB63AA64A9651B
:1010B9001205257002800D7401255FF55FE4355E28
:1010C900F55E809DAB5DAA5EA95F227B007A0079FF
:0210D9000022F3
:10065E00EF4E6012EF60010EEDBB010B89828A83B3
:10066E00F0A3DFFCDEFA2289F05007F709DFFCA9C0
:0C067E00F022BBFEFCF309DFFCA9F02217
:100FD90002139AE493A3F8E493A34003F68001F281
:100FE90008DFF48029E493A3F85407240CC8C33319
:100FF900C4540F4420C8834004F456800146F6DFE8
:10100900E4800B0102040810204080901209E47E5C
:10101900019360BCA3FF543F30E509541FFEE493DC
:10102900A360010ECF54C025E060A840B8E493A3A3
:10103900FAE493A3F8E493A3C8C582C8CAC583CACE
:10104900F0A3C8C582C8CAC583CADFE9DEE780BE86
:0112370000B6
:00000001FF

109
pro.uvgui.QY

File diff suppressed because one or more lines are too long

6
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>
@ -203,7 +203,7 @@ @@ -203,7 +203,7 @@
<GroupNumber>1</GroupNumber>
<FileNumber>2</FileNumber>
<FileType>1</FileType>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\lcd.c</PathWithFileName>
@ -215,7 +215,7 @@ @@ -215,7 +215,7 @@
<GroupNumber>1</GroupNumber>
<FileNumber>3</FileNumber>
<FileType>1</FileType>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\pwm.c</PathWithFileName>

172
pwm.LST

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
C51 COMPILER V9.56.0.0 PWM 04/06/2022 22:23:01 PAGE 1
C51 COMPILER V9.56.0.0 PWM 04/08/2022 03:07:52 PAGE 1
C51 COMPILER V9.56.0.0, COMPILATION OF MODULE PWM
@ -9,135 +9,67 @@ line level source @@ -9,135 +9,67 @@ line level source
1 #include "pwm.h"
2
3 unsigned char pwm_val_left =0;//变量定义
4 unsigned char push_val_left =0;// 左电机占空比N/20
5 unsigned char pwm_val_right =0;
6 unsigned char push_val_right=0;// 右电机占空比N/20
7 unsigned char pwm_left=0;
8
9 bit Right_moto_stop=1;
10 bit Left_moto_stop =1;
3 unsigned char pwm_val_right =0;
4 unsigned char push_val_right=0;
5
6 unsigned char pwm_value=0;
7
8 extern uint model;
9
10 bit Right_moto_stop = 0;
11
12 unsigned int time1=0;
13
14
15
16 /************************************************************************/
17 //延时函数
18 void delay(unsigned int k)
19 {
20 1 unsigned int x,y;
21 1 for(x=0;x<k;x++)
22 1 for(y=0;y<2000;y++);
23 1 }
24 /************************************************************************/
25 //前速前进
26 void run(void)
27 {
28 1 push_val_left=3; //速度调节变量 0-20。。。0最小,20最大
29 1 push_val_right=pwm_left;
30 1 Left_moto_go ; //左电机往前走
31 1 Right_moto_go ; //右电机往前走
32 1 }
33
34 void backrun(void)
35 {
36 1 push_val_left=3; //速度调节变量 0-20。。。0最小,20最大
37 1 push_val_right=4;
38 1 Left_moto_back; //左电机往前走
39 1 Right_moto_back; //右电机往前走
40 1 }
41
42
43 //左转
44 void leftrun(void)
45 {
46 1 push_val_left=0;
47 1 push_val_right=4;
48 1 Right_moto_go ; //右电机往前走
49 1 }
12 void delay(unsigned int k)
13 {
14 1 unsigned int x,y;
15 1 for(x=0;x<k;x++)
16 1 for(y=0;y<2000;y++);
17 1 }
18
19 void run(void)
20 {
21 1 if(model == 0) pwm_value = 0;
22 1 else if(model == 1) pwm_value = 2;
23 1 else if(model == 2) pwm_value = 5;
24 1 else pwm_value = 10;
25 1 push_val_right=pwm_value;
26 1 Right_moto_back;
27 1 }
28
29 void pwm_out_right_moto(void)
30 {
31 1 pwm_val_right++;
32 1 if(~Right_moto_stop){
33 2 if(pwm_val_right <= push_val_right)
34 2 {
35 3 Right_moto_pwm=1;
36 3 }
37 2 else
38 2 {
39 3 Right_moto_pwm=0;
40 3 }
41 2 if(pwm_val_right>=20) pwm_val_right=0;
42 2 }
43 1 else{
44 2 Right_moto_pwm=0;
45 2 }
46 1 }
47
48
49
50
51
52 //右转
53 void rightrun(void)
54 {
55 1 push_val_right=0;
C51 COMPILER V9.56.0.0 PWM 04/06/2022 22:23:01 PAGE 2
56 1 push_val_left=4;
57 1 Left_moto_go ; //左电机往前走
58 1 }
59
60
61 void pwm_out_left_moto(void)
62 {
63 1 if(Left_moto_stop)
64 1 {
65 2 if(pwm_val_left<=push_val_left)
66 2 {
67 3 Left_moto_pwm=1;
68 3 }
69 2 else
70 2 {
71 3 Left_moto_pwm=0;
72 3 }
73 2 if(pwm_val_left>=20)
74 2 pwm_val_left=0;
75 2 }
76 1 else
77 1 {
78 2 Left_moto_pwm=0;
79 2 }
80 1 }
81 /******************************************************************/
82 /* 右电机调速 */
83 void pwm_out_right_moto(void)
84 {
85 1 if(Right_moto_stop)
86 1 {
87 2 if(pwm_val_right<=push_val_right)
88 2 {
89 3 Right_moto_pwm=1;
90 3 }
91 2 else
92 2 {
93 3 Right_moto_pwm=0;
94 3 }
95 2 if(pwm_val_right>=20)
96 2 pwm_val_right=0;
97 2 }
98 1 else
99 1 {
100 2 Right_moto_pwm=0;
101 2 }
102 1 }
103
104 void timer1()interrupt 3
105 {
106 1 TH1=0XFc; //1Ms定时
107 1 TL1=0X18;
108 1 time1++;
109 1 // pwm_val_left++;
110 1 pwm_val_right++;
111 1 // pwm_out_left_moto();
112 1 pwm_out_right_moto();
113 1 }
114
115
116
117
C51 COMPILER V9.56.0.0 PWM 04/06/2022 22:23:01 PAGE 3
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 172 ----
CODE SIZE = 112 ----
C51 COMPILER V9.56.0.0 PWM 04/08/2022 03:07:52 PAGE 2
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 7 ----
DATA SIZE = 3 ----
IDATA SIZE = ---- ----
BIT SIZE = 2 ----
BIT SIZE = 1 ----
END OF MODULE INFORMATION.

BIN
pwm.OBJ

Binary file not shown.

128
pwm.c

@ -1,116 +1,50 @@ @@ -1,116 +1,50 @@
#include "pwm.h"
unsigned char pwm_val_left =0;//变量定义
unsigned char push_val_left =0;// 左电机占空比N/20
unsigned char pwm_val_right =0;
unsigned char push_val_right=0;// 右电机占空比N/20
unsigned char pwm_left=0;
unsigned char push_val_right=0;
bit Right_moto_stop=1;
bit Left_moto_stop =1;
unsigned char pwm_value=0;
unsigned int time1=0;
/************************************************************************/
//延时函数
void delay(unsigned int k)
extern uint model;
bit Right_moto_stop = 0;
void delay(unsigned int k)
{
unsigned int x,y;
unsigned int x,y;
for(x=0;x<k;x++)
for(y=0;y<2000;y++);
}
/************************************************************************/
//前速前进
void run(void)
{
push_val_left=3; //速度调节变量 0-20。。。0最小,20最大
push_val_right=pwm_left;
Left_moto_go ; //左电机往前走
Right_moto_go ; //右电机往前走
}
void backrun(void)
void run(void)
{
push_val_left=3; //速度调节变量 0-20。。。0最小,20最大
push_val_right=4;
Left_moto_back; //左电机往前走
Right_moto_back; //右电机往前走
}
//左转
void leftrun(void)
{
push_val_left=0;
push_val_right=4;
Right_moto_go ; //右电机往前走
if(model == 0) pwm_value = 0;
else if(model == 1) pwm_value = 2;
else if(model == 2) pwm_value = 5;
else pwm_value = 10;
push_val_right=pwm_value;
Right_moto_back;
}
//右转
void rightrun(void)
void pwm_out_right_moto(void)
{
push_val_right=0;
push_val_left=4;
Left_moto_go ; //左电机往前走
}
void pwm_out_left_moto(void)
{
if(Left_moto_stop)
{
if(pwm_val_left<=push_val_left)
{
Left_moto_pwm=1;
}
else
{
Left_moto_pwm=0;
}
if(pwm_val_left>=20)
pwm_val_left=0;
}
else
{
Left_moto_pwm=0;
}
}
/******************************************************************/
/* 右电机调速 */
void pwm_out_right_moto(void)
{
if(Right_moto_stop)
{
if(pwm_val_right<=push_val_right)
{
Right_moto_pwm=1;
}
else
{
Right_moto_pwm=0;
}
if(pwm_val_right>=20)
pwm_val_right=0;
}
else
{
Right_moto_pwm=0;
}
pwm_val_right++;
if(~Right_moto_stop){
if(pwm_val_right <= push_val_right)
{
Right_moto_pwm=1;
}
else
{
Right_moto_pwm=0;
}
if(pwm_val_right>=20) pwm_val_right=0;
}
else{
Right_moto_pwm=0;
}
}
void timer1()interrupt 3
{
TH1=0XFc; //1Ms定时
TL1=0X18;
time1++;
// pwm_val_left++;
pwm_val_right++;
// pwm_out_left_moto();
pwm_out_right_moto();
}

21
pwm.h

@ -15,26 +15,15 @@ void pwm_out_right_moto(void); @@ -15,26 +15,15 @@ void pwm_out_right_moto(void);
//定义小车驱动模块输入IO口
sbit IN1=P0^4;
sbit IN2=P0^5;
sbit IN3=P0^6;
sbit IN4=P0^7;
sbit IN1=P1^0;
sbit IN2=P1^1;
sbit EN1=P3^4;
sbit EN2=P3^5;
sbit Left_moto_pwm=P3^5; //PWM信号端
sbit Right_moto_pwm=P3^4; //PWM信号端
#define Left_moto_go {IN3=0,IN4=1;} //左电机向前走
#define Left_moto_back {IN3=1,IN4=0;} //左边电机向后转
#define Left_moto_Stop {EN1=0;} //左边电机停转
#define Right_moto_go {IN1=1,IN2=0;} //右边电机向前走
#define Right_moto_back {IN1=0,IN2=1;} //右边电机向后走
#define Right_moto_Stop {EN2=0;} //右边电机停转
#define Right_moto_Stop {EN1=0;} //右边电机停转
#endif
Loading…
Cancel
Save