📄 main.c
字号:
//========================================================================
// The information contained herein is the exclusive property of
// Sunnnorth Technology Co. And shall not be distributed, reproduced,
// or disclosed in whole in part without prior written permission.
// (C) COPYRIGHT 2003 SUNNORTH TECHNOLOGY CO.
// ALL RIGHTS RESERVED
// The entire notice above must be reproduced on all authorized copies.
//========================================================================
//========================================================================================
// 工程名称: ultrasonic_long.spj
// 功能描述: 超声波测距模组V2.0,中距测距程序
// 涉及的库: CMacro1016.lib SACMV26e.lib
// 组成文件: main.c ultrasonic_App.c Speech.c IRQ.c
// DataOS_A.asm hardware.asm isr.asm key.asm Resource.asm
// 硬件连接:
//
// 维护记录: 2006-03-01 V2.0(该版本号相对于原有超声波模组的版号)
//=========================================================================================
//========================================================================
// 文件名称: main.c
// 功能描述:
// 维护记录: 2006-03-01 V2.0
//========================================================================
#include "SPCE061A.h"
#include "ultrasonic_App.h"
//========================================================================
// 语法格式: int main(void)
// 实现功能: 主程序
// 参数: 无
// 返回值: int 无意义
//========================================================================
void F_Key_Scan_Initial(void);
void F_Key_Scan_ServiceLoop(void);
unsigned int SP_GetCh(void);
void Speech_Resource(unsigned int iSpeechIndex);
void Speech_Result(unsigned int uiResult);
int main(void)
{
unsigned int uiKey;
unsigned int Back_data;
F_Key_Scan_Initial();
Initial_ult();
while(1)
{
uiKey = SP_GetCh();
switch(uiKey)
{
case 0: break;
case 1:
Back_data = measure_Times(1);
if(Back_data==0)
Speech_Resource(12); //结果为0时表示测量出错,播放"咚"
else
Speech_Result(Back_data);
break;
case 2:
break;
case 3: break;
default: break;
}
F_Key_Scan_ServiceLoop();
*P_Watchdog_Clear = 0x0001;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -