-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrintMap.c
More file actions
125 lines (60 loc) · 1.72 KB
/
PrintMap.c
File metadata and controls
125 lines (60 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#include "includes.h"
/*--------------------------------------------------
函数: long_delay()
目的: 为传送数据提供一个短暂的延时,避免丢失数据
输入: 无
输出: 无
错误: 无
-------------------------------------------------*/
void long_delay(void) {
uint16 k,l;
for(k=0;k<2;k++)
for(l=0;l<500;l++);
}
/*--------------------------------------------------
函数: print_init_map
目的: 打印采集的原始图像
输入: 无
输出: 用串口 输出到上位机
错误: map_point 指针没有初始化
-------------------------------------------------*/
void print_init_map(void){
uint16 ii;
uint8 *map_point=&ImageBuffer[0][0];
for(ii=0;ii<RealRow*RealColumn;ii++)
{
Sci_write(*map_point);
map_point++;
}
}
void print_centerline(void) {
uint16 ii;
uint8 *point=&CenterLine[0];
for(ii=0;ii<RealRow;ii++) {
Sci_write(*point);
point++;
}
}
void print_binarymap(void) {
uint16 jj;
uint8 *point=&ImageBuffer[0][0];
for(jj=0;jj<RealRow*RealColumn;jj++) {
if(*point==1)
Sci_write('1');
else Sci_write('0');
point++;
if(!(jj%RealColumn) && jj!=0)
Sci_write(10);
}
}
void SystemStop(void){
Motor_left=0;
Motor_right=0;
SteerDirection=Direction_mid;
while(1);
}
void VoidBreak(void)
{
if(CurrentSpeed_left<=10 && CurrentSpeed_right<=10)
SystemStop();
}