嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元微信扫码支付:2 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
FMD芯片ft62f211触摸按键 实际实用实例
SYS_INITIAL(); //系统初始化
TIMER0_INITIAL(); //初始化T0
Touch_init();
while(1)
{
//CLRWDT();
if(shortpressed_count>0 && !IsPressing)
{
shortpressed_count=0;
if(!shutflag){
if( pressed_count>8) pressed_count=1;
// 如果自动切换则直接先亮,然后一下周期再按计时周期亮其它灯
if(pressed_count==1)
{
PA2=1;
PA0=PA1=0;
timer_count=0;
}
//LVDIF=0;
//if(pressed_count==0) PA1=PA3=PA4=0;
else if(pressed_count>1)
{
PA0=(pressed_count-1) & 0x01?1:0;
PA1=(pressed_count-1) & 0x02?1:0;
PA2=(pressed_count-1) & 0x04?1:0;
}
}else{
shutflag=0;
//pressed_count=1;
}
}
//大于1.6秒约为2秒
if(longpressed_count>20)
{
shutflag=1;
PA0=PA1=PA2=0;
pressed_count=0;
}
//----------------------------------------------------------------------------------
//2500/SCANNINGTIME/TouchCount=2500/12/1=208*0.4ms=83.2ms
if(StartTouchTime >= (2500/SCANNINGTIME/TouchCount))//扫描时间 根据扫描周期及按键个数计算.
{
StartTouchTime = 0;
GKeyValue = TouchKeyScan(); //按键扫描并获取按键?
if(GKeyValue==IO_TOUCH_ATTR)
{
IsPressing=1;
longpressed_count ;
shortpressed_count ;
}else{
longpressed_count=0;
IsPressing=0;
}
}
}
.
├── TouchRelase1_F7_F8_F9 -V2
│ ├── touchR1.ini
│ ├── touchR1.tch
│ └── touchlib_6021
│ ├── DIS.H
│ ├── Log.log
│ ├── MODE.H
│ ├── TOUCHLIB_6021.in
│ ├── funclist
│ ├── main.c
│ ├── main.p1
│ ├── main.pre
│ ├── main_lowppwer.c
│ ├── main_lowppwer.c.bak
│ ├── main_lowppwer.pre
│ ├── smg.c
│ ├── startup.as
│ ├── startup.lst
│ ├── startup.obj
│ ├── startup.rlf
│ ├── touch.h
│ ├── touch1.lpp
│ ├── touch2.lpp
│ ├── touch3.lpp
│ ├── touch4.lpp
│ ├── touchlib_6021.as
│ ├── touchlib_6021.asm
│ ├── touchlib_6021.bin
│ ├── touchlib_6021.cof
│ ├── touchlib_6021.hex
│ ├── touchlib_6021.hxl
│ ├── touchlib_6021.ini
│ ├── touchlib_6021.lst
│ ├── touchlib_6021.map
│ ├── touchlib_6021.obj
│ ├── touchlib_6021.prj
│ ├── touchlib_6021.rlf
│ ├── touchlib_6021.sdb
│ └── touchlib_6021.sym
├── ft62f21x_ds_rev2p00_cn.pdf
└── 好例子网_TouchRelase1_F7_F8_F9 -V2.rar
2 directories, 39 files