Post Go back to editing

ADXL峰值监测配置问题

我想要读取一段时间内的最大加速度值,这是我配置的寄存器:

ADXL372_Write(ADXL372_FIFO_CTL, 0x38);
ADXL372_Write(ADXL372_X_THRESH_ACT_H, 0x00);
ADXL372_Write(ADXL372_X_THRESH_ACT_L, 0x01);
ADXL372_Write(ADXL372_Y_THRESH_ACT_H, 0x00);
ADXL372_Write(ADXL372_Y_THRESH_ACT_L, 0x01);
ADXL372_Write(ADXL372_Z_THRESH_ACT_H, 0x00);
ADXL372_Write(ADXL372_Z_THRESH_ACT_L, 0x01);
ADXL372_Write(ADXL372_TIME_ACT, 0x02);
ADXL372_Write(ADXL372_X_THRESH_INACT_H, 0x00);
ADXL372_Write(ADXL372_X_THRESH_INACT_L, 0x01);
ADXL372_Write(ADXL372_Y_THRESH_INACT_H, 0x00);
ADXL372_Write(ADXL372_Y_THRESH_INACT_L, 0x01);
ADXL372_Write(ADXL372_Z_THRESH_INACT_H, 0x00);
ADXL372_Write(ADXL372_Z_THRESH_INACT_L, 0x01);
ADXL372_Write(ADXL372_TIME_INACT_H, 0x00);
ADXL372_Write(ADXL372_TIME_INACT_L, 0x01);
ADXL372_Write(ADXL372_MEASURE, 0XAC);

读取寄存器的代码:

BUF[0] = ADXL372_Read(ADXL372_X_MAXPEAK_L);
BUF[1] = ADXL372_Read(ADXL372_X_MAXPEAK_H);

x = (BUF[1] << 8 | BUF[0] ) ;

x = x>>4;

读取出来的数据为0 ,但直接读取xyz轴的数据是对的,想请问我的配置出来什么问题

Parents Reply Children
No Data