下面是如何使用INT1进行自由落体检测的示例。
1.将57h写入CTRL_REG1 //打开传感器,启用X,Y和Z // ODR = 100 Hz
2.将00h写入CTRL_REG2 //禁用高通滤波器
3.将40h写入CTRL_REG3 //中断活动1驱动到INT1焊盘
4.将00h写入CTRL_REG4 // FS =±2 g
5.将08h写入CTRL_REG5 //中断1引脚锁存
6.将16h写入INT1_THS //设置自由落体阈值= 350 mg
7.将03h写入INT1_DURATION //设置最小事件持续时间
8.将95h写入INT1_CFG //配置自由落体识别
9.轮询INT1垫;如果INT1 = 0,则转到10 //轮询INT1引脚,等待自由落体事件
10.(发生了自由落体事件;在此处插入代码)//事件处理
11.读INT1_SRC寄存器//清除中断请求
12.转到9
以上来自于谷歌翻译
以下为原文
Below is an example how to use INT1 for free fall detection.
1. Write 57h into CTRL_REG1 // Turn on the sensor, enable X, Y, and Z // ODR = 100 Hz
2. Write 00h into CTRL_REG2 // High-pass filter disabled
3. Write 40h into CTRL_REG3 // Interrupt activity 1 driven to INT1 pad
4. Write 00h into CTRL_REG4 // FS = ±2 g
5. Write 08h into CTRL_REG5 // Interrupt 1 pin latched
6. Write 16h into INT1_THS // Set free-fall threshold = 350 mg
7. Write 03h into INT1_DURATION // Set minimum event duration
8. Write 95h into INT1_CFG // Configure free-fall recognition
9. Poll INT1 pad; if INT1 = 0 then go to 10 // Poll INT1 pin waiting for the free-fall event
10. (Free-fall event has occurred; insert your code here) // Event handling
11. Read INT1_SRC register // Clear interrupt request
12. Go to 9
下面是如何使用INT1进行自由落体检测的示例。
1.将57h写入CTRL_REG1 //打开传感器,启用X,Y和Z // ODR = 100 Hz
2.将00h写入CTRL_REG2 //禁用高通滤波器
3.将40h写入CTRL_REG3 //中断活动1驱动到INT1焊盘
4.将00h写入CTRL_REG4 // FS =±2 g
5.将08h写入CTRL_REG5 //中断1引脚锁存
6.将16h写入INT1_THS //设置自由落体阈值= 350 mg
7.将03h写入INT1_DURATION //设置最小事件持续时间
8.将95h写入INT1_CFG //配置自由落体识别
9.轮询INT1垫;如果INT1 = 0,则转到10 //轮询INT1引脚,等待自由落体事件
10.(发生了自由落体事件;在此处插入代码)//事件处理
11.读INT1_SRC寄存器//清除中断请求
12.转到9
以上来自于谷歌翻译
以下为原文
Below is an example how to use INT1 for free fall detection.
1. Write 57h into CTRL_REG1 // Turn on the sensor, enable X, Y, and Z // ODR = 100 Hz
2. Write 00h into CTRL_REG2 // High-pass filter disabled
3. Write 40h into CTRL_REG3 // Interrupt activity 1 driven to INT1 pad
4. Write 00h into CTRL_REG4 // FS = ±2 g
5. Write 08h into CTRL_REG5 // Interrupt 1 pin latched
6. Write 16h into INT1_THS // Set free-fall threshold = 350 mg
7. Write 03h into INT1_DURATION // Set minimum event duration
8. Write 95h into INT1_CFG // Configure free-fall recognition
9. Poll INT1 pad; if INT1 = 0 then go to 10 // Poll INT1 pin waiting for the free-fall event
10. (Free-fall event has occurred; insert your code here) // Event handling
11. Read INT1_SRC register // Clear interrupt request
12. Go to 9
举报