📄 followline.lst
字号:
C51 COMPILER V7.09 FOLLOWLINE 07/01/2004 21:24:08 PAGE 1
C51 COMPILER V7.09, COMPILATION OF MODULE FOLLOWLINE
OBJECT MODULE PLACED IN FollowLine.OBJ
COMPILER INVOKED BY: D:\Keil\C51\BIN\C51.EXE FollowLine.c OMF2 ROM(COMPACT) OPTIMIZE(SIZE) REGFILE(.\FollowLine.ORC) BRO
-WSE DEBUG
line level source
1 /*
2 ┍┑ ┍┑ ┍┑ ┍┑
3 ┕┙ ┕┙ ┕┙ ┕┙
4 5 2.5 5
5 */
6
7 /* parameters needed to be adjusted
8
9 */
10
11 #include<reg52.h>
12 #include<FollowLine.h>
13 #include<intrins.h>
14
15 //~~~~~~~~~~~~~~~~~~~~~
16 bit DirectionRight;
17 bit DirectionLeft;
18
19 unsigned char iLoop = 0x00; //loop time control
20 unsigned char iSensorConfirm = 0x00; //Status confirm
21 unsigned int iStopStatus = 0x00;
22
23 //movement status
24 char PreLeftSpeed = 0; //Speed Status
25 char PreRightSpeed = 0;
26 bit PreLeftDirection = 1 ;
27 bit PreRightDirection = 1;
28
29 //~~~~~~~~~~~~~~~~~Function Declaration~~~~~~~~~~~~~~~~~~~~
30 extern void Delay(unsigned int time);
31 void MotorLeft(char Speed,bit Direction);
32 void MotorRight(char Speed,bit Direction);
33 void FollowLine(char Speed); // follow normal while line
34 void Stop(void);
35
36 //void TurnLeft(char Speed);
37 //
38 void MotorLeft(char Speed,bit Direction)
39 {
40 1 if((Speed != PreLeftSpeed)||(PreLeftDirection != Direction)) //
41 1 {
42 2 DirectionLeft = Direction; //forward
43 2 PreLeftDirection = DirectionLeft;
44 2 LeftSpeed = Speed;
45 2 PreLeftSpeed = Speed; //save speed status
46 2 iLeftCounter = 0;
47 2 }
48 1 if (TR0 == 0) //open T0 is necessary
49 1 {TR0 = 1;}
50 1 else
51 1 {}
52 1
53 1 }
54 void MotorRight(char Speed,bit Direction)
C51 COMPILER V7.09 FOLLOWLINE 07/01/2004 21:24:08 PAGE 2
55 {
56 1 if((Speed != PreRightSpeed)||(PreRightDirection != Direction)) //
57 1 {
58 2 DirectionRight = Direction; //forward
59 2 PreRightDirection = DirectionRight;
60 2 RightSpeed = Speed;
61 2 PreRightSpeed = Speed; //save speed status
62 2 iRightCounter = 0;
63 2 }
64 1 if (TR0 == 0)
65 1 {TR0 = 1;}
66 1 else
67 1 {}
68 1
69 1 }
70
71 void Stop(void)
72 {
73 1 TR0 = 0;
74 1 DriveLeftMo1 = 0;
75 1 DriveLeftMo2 = 0;
76 1 DriveRightMo1 = 0;
77 1 DriveRightMo2 = 0;
78 1 _nop_();
79 1 _nop_();
80 1 PreLeftSpeed = 0;
81 1 PreRightSpeed = 0;
82 1 }
83
84
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 84 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 6 ----
IDATA SIZE = ---- ----
BIT SIZE = 4 2
EDATA SIZE = ---- ----
HDATA SIZE = ---- ----
XDATA CONST SIZE = ---- ----
FAR CONST SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -