📄 distance.c
字号:
#include "includes.h"
/*********************************************************/
void dist_Func(void)
{
INT8U LcdDist[] = {"check distance "};
LcdWriteAll(LcdDist);
InitPA(); //读取CarDistance变量可以获得当前脉冲计数
ClearPA();
StartPA();
for(;;) {
//display PWM menu
while (KeyFlag == ON) {
KeyFlag = OFF;
if (ValueKey == Enter){CalDistance();}
else if (ValueKey == Exit) return; //if have exit key,go back
}
}
}
void CalDistance(void) {
INT16U Distance = 0;
for(;;) {
Distance = CarLocation;
LcdWrite16U(0x80,Distance,4);
Distance = CarDistance;
LcdWrite16U(0xC0,Distance,4);
while (KeyFlag == ON)
KeyFlag = OFF;
if (ValueKey == Exit) return; //if have exit key,go back
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -