[分享]MMA7660脉搏震动检测算法
/
(c) copyright Freescale Semiconductor Ltd. 2008
ALL RIGHTS RESERVED
Ver 0.01 Oct.2008 Released
Note: This is an example code shows how to handle the interrupt
generated by MMA7660 on pulse detection
/
#include "MMA7660_Pulse.h"
#define Pulse_Detection_Condition 1
void MMA7660_Pulse_main(void){
VUINT8 Ans;
MMA7660_Pulse_Startup();
Enable_Host_Interrupts_for_MMA7660; //Enable host interrupt to respond to MMA7660 INT pin
while(Pulse_Detection_Condition)
{
Ans = 0;
if((Pulse_Delay_1)||(MMA7660_InterruptPin))
{
if(Pulse_Delay_1) Pulse_Delay_1--;
}
else
{
Host_Enter_Wait_Mode;
}
Ans = MMA7660_Pulse_InterruptService();
if(Ans)
{
//Pulse Detected, add application code here:
}
}
我们是深圳本土最受客户青睐、成长最快、最关注增值服务的MID电子元件提供商之一。我们深圳的长期大量现货型号有:MMA7660, MMA7455, MMA8452QR1, MXC6225XU, MMC3140MS, TS1003,MPU-3050, ALC5621, ALC5625, WM8988, ES8388,联系热线:13714686590,杨先生
} 链接地址:
发表时间:2011年9月2日10:05:40