您好,欢迎光临!   请登录 免费注册    
  您的位置:电子变压器资讯网 > 资讯中心 >  技术文章 > 正文
触控设备手势唤醒的设计思路及其实现
[发布时间]:2012年7月16日 [来源]:电子发烧友 [点击率]:5404
【导读】: 本文讨论如何唤醒平板电脑等触控装置,无需接触设备,而是采用基本的手势识别及新颖的接近检测传感器。本文讨论了相关设计的物理布局、速度限制、检测门限、系统集成,以及人为因素的影响;给出了软件实时的例程...

  ...

  ...

  }

  }

  ...

  ...

  }

示例代码2

  // example interrupt function where this might be implemented

  __interrupt void TimedInterrupt( void )

  {

  uint8 proximity_counts;

  uint8 filtered_counts;

  ....

  ....

  if ( device_status == SLEEP_MODE )

  {

  // read one byte from register 0x16

  proximity_counts = read_i2c_register(MAX44000_ADDR,0x16,1);

  // weights[QUEUE_SIZE] contains the filter weights for the FIR filter

  // data_queue[QUEUE_SIZE] is a FIFO queue meant to be the input to the filter

  filtered_counts = fir_filter(proximity_counts,weights,data_queue);

  if (filtered_counts 》 WAKEUP_THRESHOLD)

  {

  device_status = WAKE_MODE;

  ...

  }

  else

  {

  // do whatever it is you need to in sleep mode

  ...

  ...

  }

  }

  ...

  ...

  }

  /**

  * fir_filter()

  *

  * Implements an FIR filter in the form

  * y = w[0]*x[0] + w[1]*x[1] + 。。.+ w[QUEUE_SIZE]*x[QUEUE_SIZE]

  *

  * Arguments:

  * uint8 input - newest datapoint taken (that is, x[0])

  * uint8 *weights - w[0]。。.w[QUEUE_SIZE]

  * uint8 *queue - the discrete sequence x[0]。。.x[QUEUE_SIZE]

  *

  * Returns:

  * The FIR-filtered output, y

  */

  uint8 fir_filter(uint8 input, uint8 *weights, uint8 *queue)

  {

  uint8 i;

  int sum = 0;

  // pop first entry in the queue, then

  // push new data into the last position

  push_into_queue(queue,input);

  // input is now x[0]

  for (i=0; i {

  sum += weights[i]*queue[i];

  }

  return (sum/QUEUE_SIZE);

  }

示例代码3

  // this handles hardware-level interrupts on the micro

投稿箱:
   电子变压器、电感器、磁性材料等磁电元件相关的行业、企业新闻稿件需要发表,或进行资讯合作,欢迎联系本网编辑部QQ: , 邮箱:info%ett-cn.com (%替换成@)。
第一时间获取电子变压行业资讯,请在微信公众账号中搜索“电子变压器资讯”或者“dzbyqzj”,或用手机扫描左方二维码,即可获得电子变压器资讯网每日精华内容推送和最优搜索体验,并参与活动!
温馨提示:回复“1”获取最新资讯。