电容触摸传感的理论框架

物联网与传感器   作者:Thomas Perme 微芯科技公司 应用工程师 时间:2009-07-20来源:电子产品世界

if (INDEX == 3) {
 // 如果扫描结束,则执行以下操作

if (PctArray[0] > PCT_ON) {
 // (受影响程度最高的百分比是否大于PCT_ON值?.. 是)
  
 // 按钮被按下
 switch(IndxArray[0]) {
  case 0: Buttons.BTN0 = 1; // 设置按键的标志
    Buttons.BTN1 = 0;    
    Buttons.BTN2 = 0;    
    Buttons.BTN3 = 0;    
    break;       
  case 1: Buttons.BTN0 = 0;
    Buttons.BTN1 = 1;
    Buttons.BTN2 = 0;
    Buttons.BTN3 = 0;
    break;      
  case 2: Buttons.BTN0 = 0;
    Buttons.BTN1 = 0;
    Buttons.BTN2 = 1;
    Buttons.BTN3 = 0;
    break;      
  case 3: Buttons.BTN0 = 0;
    Buttons.BTN1 = 0;
    Buttons.BTN2 = 0;
    Buttons.BTN3 = 1;
    break;      
  default: break;
 }
  
} else if (PctArray[0] < PCT_OFF) {
 // 受影响程度最高的按钮是否高于开路时的程度?
 // .. 释放所有按钮。
 Buttons.BTN0 = 0; 
 Buttons.BTN1 = 0;
 Buttons.BTN2 = 0;
 Buttons.BTN3 = 0;
}

} // 结束:if (INDEX == 3){ , 仅限于完整的扫描 

1 2 3 4 5 6 7 8

关键词: 微芯 传感器 电容触摸传感 容性耦合 充电周期 充电速率 寄生电容 频率偏移

加入微信
获取电子行业最新资讯
搜索微信公众号:EEPW

或用微信扫描左侧二维码

相关文章

查看电脑版