高级会员

- 积分
- 582
- 金钱
- 582
- 注册时间
- 2019-8-4
- 在线时间
- 187 小时
|
1金钱
这个例程里面的
void ctp_test(void)
{
u8 t=0;
u8 i=0;
u16 lastpos[5][2]; //记录最后一次的数据
while(1)
{
tp_dev.scan(0);
for(t=0;t<CT_MAX_TOUCH;t++)
{
if((tp_dev.sta)&(1<<t))
{
if(tp_dev.x[t]<lcddev.width&&tp_dev.y[t]<lcddev.height)
{
if(lastpos[t][0]==0XFFFF)
{
lastpos[t][0] = tp_dev.x[t];
lastpos[t][1] = tp_dev.y[t];
}
lcd_draw_bline(lastpos[t][0],lastpos[t][1],tp_dev.x[t],tp_dev.y[t],2,POINT_COLOR_TBL[t]);//画线
lastpos[t][0]=tp_dev.x[t];
lastpos[t][1]=tp_dev.y[t];
if(tp_dev.x[t]>(lcddev.width-24)&&tp_dev.y[t]<16)
{
Load_Drow_Dialog();//清除
}
}
}else lastpos[t][0]=0XFFFF;
}
delay_ms(5);i++;
if(i%20==0)LED0=!LED0;
}
}是干什么用的,电容屏要校准?
|
|