#include "zero.h"
#define p (unsigned int*) 0x0050
unsigned int num[]={'0','1','2','3','4','5','6','7','8','9'};
const char ss[]={'S','e','a','r','c','h','i','n','g','.','.','.'};
const char fre[]={'T','h','e',' ','f','r','e',' ','i','s',':'};
unsigned int i,temp,j,f,long1,k,f0,key;
unsigned int a=0;
unsigned long int Fre;
main()
{
unsigned int l,s;
temp=0;
*P_IOA_Dir=0x3fff; //初始化
*P_IOA_Attrib=0x3fff;
*P_IOA_Data=0x0000;
chushi();
i=0;
while(1) //输入频率
{*P_Watchdog_Clear=0x0001;
l=key1();
if((l&0x0f00)!=0x0f00)
{s=KeyFind();
Delay2();
if((s<=9)&&(s>=0))
{
long1=0;
if(a<5)
{*(p+a)=s;
a++;}
}
else switch(s)
{case 10:temp=1;break;
case 15:a=0;for(j=0;j<10;j++) *(p+j)=0;break;
}
}
if(a>0) f=*p;
for(k=1;k<a;k++) f=10*f+(*(p+k));
f=(f-10700)/5;
SIO_IOA(f);
qp();
Address1(); //显示频率
xianshi('F');
xianshi('=');
for(j=0;j<a;j++) xianshi(num[*(p+j)]);
xianshi('k');
xianshi('H');
xianshi('z');
*P_Watchdog_Clear=0x0001;
Delay2();
if(temp==1)
{f0=0x1130;
while(1)
{SIO_IOA(f0++);
Address1();
for(j=0;j<12;j++)xianshi(ss[j]);
f=f0*5+10700;
*p=(f/10000)%10;//万位(几十M)
*(p+1)=(f/1000)%10;//千位
*(p+2)=(f/100)%10;//百位
*(p+3)=(f/10)%10;//十位
*(p+4)=f%10;//个位
Address2();
xianshi('F');
xianshi('=');
for(j=0;j<5;j++) xianshi(num[*(p+j)]);
xianshi('k');
xianshi('H');
xianshi('z');
Delay3();
if(f0==0x1770)f0=0x1130;
*P_IOA_Dir=0x3fff;
*P_IOA_Attrib=0x3fff;
key=*P_IOA_Data;
if((key&0x8000)==0x8000)break;
}
while(1)
{qp();
Address1();
for(j=0;j<11;j++)xianshi(fre[j]);
Address2();
for(j=0;j<5;j++) xianshi(num[*(p+j)]);
xianshi('k');
xianshi('H');
xianshi('z');
Delay2();
l=key1();
if((l&0x0f00)!=0x0f00){temp=0;break;}
}
}
}
}
suoxianghuan.rar_频率控制_频率码控制
版权申诉
197 浏览量
2022-09-19
13:19:48
上传
评论
收藏 7KB RAR 举报
![avatar](https://profile-avatar.csdnimg.cn/6a7aa99d23544fe38965063dcf203f49_weixin_42664597.jpg!1)
小贝德罗
- 粉丝: 71
- 资源: 1万+
最新资源
- 数据库管理工具:dbeaver-ce-23.3.2-x86-64-setup.exe
- 数据库管理工具:dbeaver-ce-23.3.2-stable.x86-64.rpm
- 无人驾驶汽车如何处理地图和定位?
- 数据库管理工具:dbeaver-ce-23.3.2-macos-x86-64.dmg
- 数据库管理工具:dbeaver-ce-23.3.2-macos-aarch64.dmg
- jsp+mysql学生支出管理系统(美化版)-期末作业jsp作业大学java作业大学作业
- 数据库管理工具:dbeaver-ce-23.3.1-stable.x86-64.rpm
- AndroidOCR源码.zip
- 数据库管理工具:dbeaver-ce-23.3.0-x86-64-setup.exe
- 数据库管理工具:dbeaver-ce-23.3.0-stable.x86-64.rpm
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
评论0