完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
您好:最近在做关于ADXL这方面,传感器能读取三轴的加速的和偏转角度,但是在做敲击中断的时候,中断映射管脚INT1一直是高电平,能帮忙分析一下是什么原因吗?INT1配置为下拉输入,上升沿触发。初始化程序如下:
I2C_WriteData(DATA_FORMAT,0x0B); I2C_WriteData(BW_RATE,0x08); I2C_WriteData(POWER_CTL,0x28); //I2C_WriteData(INT_ENABLE,0x00); I2C_WriteData(THRESH_TAP,0x20); I2C_WriteData(DUR,0xF0); I2C_WriteData(Latent,0x12); I2C_WriteData(Window,0x80); I2C_WriteData(TAP_AXES,0x07); I2C_WriteData(INT_MAP,0x00); I2C_WriteData(INT_ENABLE,0x60); I2C_WriteData(0x1E,0x00); I2C_WriteData(0x1F,0x00); I2C_WriteData(0x20,0x05); |
|
相关推荐
1个回答
|
|
可用如下代码
buf[0] = XL345_RATE_100; //Output Data Rate: 100Hz xl345Write(1, XL345_BW_RATE, buf); buf[0] = XL345_FULL_RESOLUTION; //Data Format: +/-16g range, right justified, 256->1g xl345Write(1, XL345_DATA_FORMAT, buf); buf[0] = XL345_TAP_X_ENABLE | XL345_TAP_Y_ENABLE | XL345_TAP_Z_ENABLE; //Enable Z Axis Tap Detection xl345Write(1, XL345_TAP_AXES, buf); buf[0] = 0x20; //Tap Threshold:2G, 62.5mg/LSB xl345Write(1, XL345_THRESH_TAP, buf); buf[0] = 0x50; //Dur:50ms, 625us/LSB, representing the maximum time //that an event must be above the THRESH_TAP threshold to qualify as a tap event xl345Write(1, XL345_DUR, buf); buf[0] = 0x20; //Latent: 40ms, 1.25ms/LSB, interval between the first tap and the second tap xl345Write(1, XL345_LATENT, buf); buf[0] = 0xF0; //Window: 300ms, 1.25ms/LSB, time window for a possible second tap event xl345Write(1, XL345_WINDOW, buf); buf[0] = XL345_SINGLETAP | XL345_DOUBLETAP; //INT_Enable: SINGLE TAP & DOUBLE TAP xl345Write(1, XL345_INT_ENABLE, buf); buf[0] = XL345_SINGLETAP | XL345_DOUBLETAP; //INT_Map: SINGLE TAP& DOUBLE TAP interrupt to INT2 pin, DOUBLE TAP interrupt to INT1 pin xl345Write(1, XL345_INT_MAP, buf); buf[0] = 0X08; //Power CTL: Measure mode xl345Write(1, XL345_POWER_CTL, buf); |
|
|
|
只有小组成员才能发言,加入小组>>
870 浏览 2 评论
给ADUM4223 增加信号驱动15V电压就不正常, 波动很大会被烧是什么情况?
1311 浏览 2 评论
ADP5092 SYS端口为2.09V,但是REG_OUT为0是什么原因?
1907 浏览 1 评论
ad7193差分输入ain1与ain2差是正值时,读到电压与实际值误差小,但为负值值,误差就变的很大
4246 浏览 2 评论
9006 浏览 1 评论
ADC3442采集,分析数据出现有规则毛刺,请问是哪方面的问题啊?
1437浏览 3评论
AD7190状态寄存器一直是0x80,连续转换模式下RDY不拉低
1656浏览 2评论
877浏览 2评论
1631浏览 2评论
给ADUM4223 增加信号驱动15V电压就不正常, 波动很大会被烧是什么情况?
1311浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-29 18:08 , Processed in 1.073750 second(s), Total 79, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号